RE: Does just “opc_items_object.AddItem” work at all?
Yes, I have a C# program that is happing
calling “opc_items_object.AddItem”.

RE: That should work if it’s an IDispatch com object
This is what I got from OLE-COM ObjectViewer

interface OPCItems : IDispatch {


So I am assuming that it is an IDispatch. By the way, my IronPython info is:

IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.4927


And.....
I finally figured out how to call the method from an unbound class. I
thought it was a C# thing, it struck me that it was Python's.

Finally.... would this be an issue with IronPython? I can file an issue on
this one but I am afraid that this can't be replicated in other machines
without using a specific implementation of OPC Server.

Thanks,
Yngipy

On Thu, Aug 12, 2010 at 4:14 PM, Dino Viehland <di...@microsoft.com> wrote:

>  Does just “opc_items_object.AddItem” work at all?  That should work if
> it’s an IDispatch com object or if it has IProvideTypeInfo.
>
>
>
> If not the workaround is to use the interface to dispatch through as you’ve
> discovered.  Rather than constructing an object with the interface though
> you do:
>
>
>
> IComInterface.AddItem(comObject, 'OPC path here',
> opc_grp_object.ClientHandle)
>
>
>
>
>
> *From:* users-boun...@lists.ironpython.com [mailto:
> users-boun...@lists.ironpython.com] *On Behalf Of *yngipy hernan
> *Sent:* Wednesday, August 11, 2010 7:21 PM
> *To:* Discussion of IronPython
> *Subject:* [IronPython] Calling COM method returns generic
> System.__ComObject?
>
>
>
> Hi All,
>
>
>
> I have been playing around IronPython + COM + OPC (COM not the .Net).
>
>
>
> One of the calls in OPC is (pseudocode):
>
>
>
> item = opc_items_object.AddItem('OPC path here',
> opc_grp_object.ClientHandle)
>
>
>
> The issue is that item is returned as System.__ComObject. All methods that
> are available for OPCItem interface are gone???
>
>
>
> I have search the internet and it seems like opc_items_object should have a
> coclass for IronPython to figure out how to return object properly.
> Unfortunately this is not the case, based on the IDL OPCItems don't have a
> coclass definition.
>
>
>
> Is there a work-around for this?
>
>
>
> I have also come across a possible work-around by using unbound class
> instance, i.e., outParamAsReturnValue =
> InteropAssemblyNamespace.IComInterface(comObject).
>
>
>
> But I can't figure out how to use it.
>
>
>
> I would really appreciate anyone can point me out to the right direction.
>
>
>
> Regards,
>
> Yngipy
>
> _______________________________________________
> Users mailing list
> Users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to