[IronPython] py to ip
Rodney Howeedy
Rodney.Howeedy at Sun.COM
Wed Feb 4 20:07:03 CET 2009
Glauco:
1) I don't recall using tlbimp to try to create an EXPorted COM Interop
assembly. I may have my notes incorrect so double check against the
tutorial. I used tlbexp to EXPort the COM Interop assembly into a .NET
2.0 output file. Here's my command line (note: you can get help from
tlbexp for additional parameter inputs):
D:\IronPython 2.0\SIEK\9.2_OTAClient>"d:\Program
Files\Microsoft.NET\SDK\v2.0\Bin\TlbExp.exe" "d:\IronPython
2.0\SIEK\9.2_OTAClient\OTAClient.dll"
2) I edited my \lib\site.py file and added the complete path to my
converted output file, "OTAClient.dll", at the path shown on the above
command line.
3) I then was able to use clr to iPy import my correctly exported COM
Interop Assembly file:
import clr
clr.AddReferenceToFile("OTAClientInterop.dll")
from OTAClientInterop import *
Shri Borde wrote:
> I don't know much about remote COM (is that the same as DCOM?). IronPython supports invocation on OLEAUT objects. It has only minimal support for creating such objects (via. clr.AddReferenceToTypeLib), and otherwise relies on the user to create the object using the CLR (Type.GetTypeFromProgID) or other means. You can check if any of the Activator.CreateInstance overloads (http://msdn.microsoft.com/en-us/library/system.activator.createinstance.aspx) support remote COM.
>
> Furthermore, I doubt if Mono supports even local COM interop. If you can't do it from C# on Mono, you won't be able to do it from IronPython on Mono either. I think you will need to find COM adapters that allow you to access COM from Linux and use those...
>
> -----Original Message-----
> From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Glauco Uri
> Sent: Wednesday, February 04, 2009 12:49 AM
> To: Discussion of IronPython
> Subject: Re: [IronPython] py to ip
>
> Shri Borde ha scritto:
>
>> See http://blogs.msdn.com/shrib/archive/2008/07/30/idispatch-support-on-in-ironpython-beta-4.aspx for the details.
>>
>>
>>
>
>
> Thank you Shri, i've done some try and this still work well:
>
> IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.1433
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import System
> >>> System.Type.GetTypeFromProgID("DSXXXX.XXXXChannel")
> <System.RuntimeType object at 0x000000000000002B [System.__ComObject]>
> >>> qq = System.Type.GetTypeFromProgID("DSAXXXX.XXXXChannel")
> >>> System.Activator.CreateInstance( qq )
> <System.__ComObject (_XXXXChannel) object at 0x000000000000002C>
> >>>
>
>
> But now i've some question:
>
> - the "GetTypeFromProgID" method let me use an installed COM objec over
> the PC still running this ipy script. This don't use Interop i think
> If this is corerct i cannot in any way use remotley this object?
>
>
> Try to explain my issue:
> I'm writing a web application over a linux Server (A).
> Some financial data come from "Thomson Datastream" using this COM obj
> installed on a Windows Server (B).
> My purpose is to call this COM remotely from linux server.
>
> probably i'm doing somethin wrong but from ipy description i've
> understood this i possible.
>
> Thank's
> Glauco
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
> _______________________________________________
> 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