Re: [IronPython] py to ip

2009-02-04 Thread Glauco Uri

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(DS.Channel)
System.RuntimeType object at 0x002B [System.__ComObject]
 qq = System.Type.GetTypeFromProgID(DSA.Channel)
 System.Activator.CreateInstance( qq )
System.__ComObject (_Channel) object at 0x002C



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@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] py to ip

2009-02-04 Thread Glauco Uri

António Piteira ha scritto:

I'm sorry, forget what I said... I have done AddReferenceToFile, my
mistake.

But still, what is the output?

  

None, nothing happens.

Seems that tlbimp hasnot worked well.
how can i test my converted dll ?

thank you
Glauco
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] py to ip

2009-02-04 Thread Shri Borde
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-boun...@lists.ironpython.com 
[mailto:users-boun...@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(DS.Channel)
System.RuntimeType object at 0x002B [System.__ComObject]
  qq = System.Type.GetTypeFromProgID(DSA.Channel)
  System.Activator.CreateInstance( qq )
System.__ComObject (_Channel) object at 0x002C
 


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@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


Re: [IronPython] py to ip

2009-02-04 Thread Rodney Howeedy

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_OTAClientd:\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-boun...@lists.ironpython.com 
[mailto:users-boun...@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(DS.Channel)
System.RuntimeType object at 0x002B [System.__ComObject]
  qq = System.Type.GetTypeFromProgID(DSA.Channel)
  System.Activator.CreateInstance( qq )
System.__ComObject (_Channel) object at 0x002C
 


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@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
  

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] py to ip

2009-02-03 Thread Glauco Uri

How is the best practice to convert this code in Iron?

 import win32com.client
 win32com.client.Dispatch(DS.Channel)
win32com.gen_py.DSA -_Channel instance at 0x15331416



I've tryed this but don't work:
 import clr
 clr.AddReferenceToFile(DS.dll)
 import DS
 clr.SetCommandDispatcher( DSX.Channel )


dll was converted following the instruction in Tutorial.htm



Thank you
Glauco
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] py to ip

2009-02-03 Thread António Piteira
I'm sorry, forget what I said... I have done AddReferenceToFile, my
mistake.

But still, what is the output?

-

How is the best practice to convert this code in Iron?

  import win32com.client
  win32com.client.Dispatch(DS.Channel)
win32com.gen_py.DSA -_Channel instance at 0x15331416
 


I've tryed this but don't work:
  import clr
  clr.AddReferenceToFile(DS.dll)
  import DS
  clr.SetCommandDispatcher( DSX.Channel )
 

dll was converted following the instruction in Tutorial.htm



Thank you
Glauco
___
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


Re: [IronPython] py to ip

2009-02-03 Thread Shri Borde
See 
http://blogs.msdn.com/shrib/archive/2008/07/30/idispatch-support-on-in-ironpython-beta-4.aspx
 for the details.

 import System
 t = System.Type.GetTypeFromProgID(Excel.Application)
 excel = System.Activator.CreateInstance(t)
 wb = excel.Workbooks.Add()


-Original Message-
From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of António Piteira
Sent: Tuesday, February 03, 2009 9:15 AM
To: 'Discussion of IronPython'
Subject: Re: [IronPython] py to ip

I'm sorry, forget what I said... I have done AddReferenceToFile, my
mistake.

But still, what is the output?

-

How is the best practice to convert this code in Iron?

  import win32com.client
  win32com.client.Dispatch(DS.Channel)
win32com.gen_py.DSA -_Channel instance at 0x15331416
 


I've tryed this but don't work:
  import clr
  clr.AddReferenceToFile(DS.dll)
  import DS
  clr.SetCommandDispatcher( DSX.Channel )
 

dll was converted following the instruction in Tutorial.htm



Thank you
Glauco
___
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

___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com