[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: In need of help. Win32Ole objWMIService.Create?

Dave Burt

12/7/2005 3:14:00 PM

Hi,

x1 asked:
> objWMIService.Create takes a parameter which is set to the pid of a
> given process..
> ...
> How can I set a variable equal to the pid value just as the vb script
> does?
> ...
> I did find an object in ObjectSpace that has the "notepad" command and
> displays the PID:

The _invoke method takes an array of values and an array of types. Your
interesting ObjectSpace array looks like the array of values you might get
back if you gave _invoke the dispid of the method, ["notepad",nil,nil,nil],
and the types. But you can't reflect on Create or other Win32_Process
methods to get that dispid or those types.

This is only a partial answer, but for some situations, the win32-utils
project and win32-process in particular may prove an adequate replacement
for this function. win32-process provides Process.create which wraps Win32's
CreateProcess() and returns a PID. It gives you fork (more or less), wait
and kill as well.

Cheers,
Dave