[IronPython] GetRunningObjectTable

Jeff Hardy jdhardy at gmail.com
Wed Apr 27 22:05:39 CEST 2011


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
<sdementen at gmail.com> 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
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>



More information about the Ironpython-users mailing list