comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Spawning EML Scripts in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Spawning EML Scripts in IDL [message #51876 is a reply to message #51874] Thu, 14 December 2006 08:38 Go to previous messageGo to previous message
Matt[1] is currently offline  Matt[1]
Messages: 23
Registered: December 2006
Junior Member
Thanks for the great replies:

To recap, it seems like there are two steps that I need to get a grasp
of (followed by what I am begining to understand from responses - bear
with me, I'm a total newbie) -

1. Identify whether the file I want to use in IDL is being used by
another program.

2. If it is in fact being used, identify the process using it and kill
it

With regard to 1. Unfortunately, I can't use the SPAWN PID keyword to
identify the process because I'm actually spawning a windows BAT file
that in turn spawns the EML script. So the PID will identify the BAT
process, which finishes in less than one second. Also, the File_test
read/write keywords, from what I can tell, identify whether you have
read/write permissions within that directory (am I wrong? In any case,
the keywords are telling me that I can read/write a file that is being
used by another process). SO... I'm beginning to think that I need to
get a better grasp of IDL error handling functions. Can I just have IDL
report/catch/capture the error (when it tries to move a file that it
can't) and move on to the next line withouth going back to interactive
mode?

With regard to 2. It seems that killing an app can't be done through
IDL but could be done through vb. Rick, thanks for the info, and thanks
for giving me something to do over the weekend because I don't know ANY
vb...

Thanks helpful people...

Matt


Rick Towler wrote:
> On windows you can use the WMI (Windows Management Interface). You
> could probably do this via IDLcomIDispatch, but spawning vb script is
> easier. Something like this should suffice:
>
> Dim objWMIService, objProcess, colProcess
> Dim strComputer, strProcessKill
> strComputer = "."
> strProcessKill = "'eml.exe'"
>
> Set objWMIService = GetObject("winmgmts:" _
> & "{impersonationLevel=impersonate}!\\" _
> & strComputer & "\root\cimv2")
>
> Set colProcess = objWMIService.ExecQuery _
> ("Select * from Win32_Process Where Name = " & strProcessKill )
> For Each objProcess in colProcess
> objProcess.Terminate()
> Next
>
> WScript.Quit
>
> -Rick
>
> Robbie wrote:
>> File locking is generally operating system dependent. Although, the
>> file lock should be released if you terminate the EML process. You can
>> find the process id by using the PID keyword in spawn. You can then
>> terminate it using kill (UNIX) or a call to a MFC function (Windows)
>>
>> Robbie
>>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to get a very large 2D projected surface image
Next Topic: Re: Licensing problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 12:48:43 PDT 2025

Total time taken to generate the page: 0.00421 seconds