From: x1 Date: 2005-12-08T14:35:23+09:00 Subject: Re: Win32OLE: Output parameters, Dispatch IDs I have not been able to figure anything out yet myself. Do you know off hand how one would be able to find any variable names(if exist) that are pointing to a given object? For instance when looking at ObjectSpace.cantremembermethodname(Array) You get something like: ["notepad", nil, nil, 333] How would one be able to determine the object id and / or any variable names associated with it? On 12/7/05, Dave Burt wrote: > Hi, > > x1 recently asked about an issue with a WMI script that had an output parameter. > I guess you can get a result from an output parameter via WIN32OLE#_invoke (with > VT_BYREF?) if you have the Dispatch ID for the method. But for a few WMI objects > I've seen recently, I haven't been able to get a WIN32OLE_METHOD instance for a > lot of methods, even ones that I can invoke. For example: > > # 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) > > That last parameter is an output parameter which should return the PID of the > created process as a uint32. > > Is there a way I can get info on a method like that, and how do I get the result > of an output parameter? > > Cheers, > Dave > > >