views:

237

answers:

1

I'm using IronPython 2.0 in a SharpDevelop 3.1 console window. I'm trying to reference and use the Redemption CDO replacement library.

The standard usage for the library is to instantiate an RDOSession object, then use the methods on that object to navigate through the RDO object model.

I've registered the Redemption COM dll and referenced it from a project, which created an interop assembly for it. In the IronPython console window, I then do the following: import clr clr.AddReferenceToFileAndPath(r'd:\SharpDevelop Projects\TestPython\TestPython\obj\Debug\Interop.Redemption.dll') import Redemption

This works so far. The next step would be to get an RDOSession object and instantiate it. If it worked, this would be how I would think to do that:

session = Redemption.RDOSession()

However, this gives an error: TypeError: Cannot create instances of RDOSession

So my question is (or was): how do I instantiate an object like RDOSession?

However, I just answered my own question in my attempt to explain it. I'll continue with the answer since despite the fact that it almost seems silly to do so, perhaps it will be useful to someone else.

When I went to type in the line "session = Redemption.RDOSession()", the calltip came up with "RDOSession" as well as "RDOSessionClass" right below it. I don't know how the latter was generated, but it sounded like an instantiable (if that's a word) object.

>>> session = Redemption.RDOSessionClass()

>>>

Lo and behold. Calling the Logon method worked like a champ on the new session object.

Thanks stackoverflow!

A: 

You need to use:

session = Redemption.RDOSessionClass()
Tartley
Ha har! It worked! :-) I owe ya one.
Tartley