Hello,
In message "Re: Win32OLE: Output parameters, Dispatch IDs"
on 05/12/09, Masaki Suketa <masaki.suketa / nifty.ne.jp> writes:
> > # Get a Win32_Process WMI object
> > wmi_svc = WIN32OLE.connect("winmgmts:\\\\.\\root\\cimv2:Win32_Process")
> > # Try to get the method
> > wmi_svc.ole_method("Create") #=> WIN32OLERuntimeError: Not found Create
> > # Invoke the method
> > wmi_svc.invoke("Create", "notepad", nil, nil, nil) #=> (Creates notepad.exe process)
> (snip)
> > Is there a way I can get info on a method like that, and how do I get the result
> > of an output parameter?
>
> You can get the result of an output parameter using WIN32OLE::ARGV.
>
> wmi_svc = WIN32OLE.connect("winmgmts:\\\\.\\root\\cimv2:Win32_Process")
> wmi_svc.invoke("Create", "notepad", nil, nil, nil)
> p WIN32OLE::ARGV # => ["notepad", -2147352572, -2147352572, 1704]
>
> I am going to investigate why ole_method is failed.
> Please wait for a while.
WIN32OLE researches type library to get info on method.
But, it seems to me that the "Create" method is not entried in the
type library "Microsoft WMI Scripting V1.1 Library".
So, Win32OLE was failed to get info on "Create" method and
unfortunately, there is no way to get info on the "Create" method.
Regards,
Masaki Suketa