GetRunningObjectTable

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GetRunningObjectTable

Sébastien de Menten
Hi,
 
I am trying to use the GetRunningObjectTable function to retrieve a list of all running objects (to later use them in COM automation).
 
I do the following :
 
>>> import System
>>> System.Runtime.InteropServices.ComTypes.IBindCtx.GetRunningObjectTable(0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: expected IBindCtx, got int
 
I am puzzled by the error as, if i understood properly the way ipy works, I would expect to give an Int as input parameter and get back a tuple with the restult of the function and the out parameter.
 
If i replace the 0 with a refernce to a IBindCtx type:
>>> import clr
>>> rot=clr.Reference[System.Runtime.InteropServices.ComTypes.IBindCtx]()
>>> System.Runtime.InteropServices.ComTypes.IBindCtx.GetRunningObjectTable(rot)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: expected IBindCtx, got StrongBox[IBindCtx]
 
My knowledge of .net is quite reduced ... any help would be greatly appreciated
 
sebastien
 
ps: sorry if this message appears as reposted but I do not see it in the mailing list after more than 24 hours ...

_______________________________________________
Users mailing list
[hidden email]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Reply | Threaded
Open this post in threaded view
|

Re: GetRunningObjectTable

Jeff Hardy-4
GetRunningObjectTable isn't a static method, so you'll need to call it
on an instance of IBindCtx. Not sure where you'd get one of those,
though.

- Jeff

On Wed, Apr 27, 2011 at 1:40 PM, Sébastien de Menten
<[hidden email]> wrote:

> Hi,
>
> I am trying to use the GetRunningObjectTable function to retrieve a list of
> all running objects (to later use them in COM automation).
>
> I do the following :
>
>>>> import System
>>>>
>>>> System.Runtime.InteropServices.ComTypes.IBindCtx.GetRunningObjectTable(0)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: expected IBindCtx, got int
>
> I am puzzled by the error as, if i understood properly the way ipy works, I
> would expect to give an Int as input parameter and get back a tuple with the
> restult of the function and the out parameter.
>
> If i replace the 0 with a refernce to a IBindCtx type:
>>>> import clr
>>>> rot=clr.Reference[System.Runtime.InteropServices.ComTypes.IBindCtx]()
>>>>
>>>> System.Runtime.InteropServices.ComTypes.IBindCtx.GetRunningObjectTable(rot)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> TypeError: expected IBindCtx, got StrongBox[IBindCtx]
>
> My knowledge of .net is quite reduced ... any help would be greatly
> appreciated
>
> sebastien
>
> ps: sorry if this message appears as reposted but I do not see it in the
> mailing list after more than 24 hours ...
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
_______________________________________________
Users mailing list
[hidden email]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com