[IronPython] Intefaces

Dino Viehland dinov at exchange.microsoft.com
Thu Oct 19 02:06:02 CEST 2006

What do you mean by Uninitialized?  Are you getting back None?

What you should get back is an instance of the class that implements the interface.  If the class is implementing the interface explicitly (so the method is actually declared w/o public in C# and w/ the interface name) then you'll need to call through the interface passing in the instance directly, eg:

result = gp.Execute(...)
IGeoProcessorResult.DoSomething(result, ...)

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Jason Pardy
Sent: Wednesday, October 18, 2006 2:05 PM
To: users at lists.ironpython.com
Subject: [IronPython] Intefaces


I have a case where my namespace contains many interfaces and classes. One of my classes contains a method that returns a pointer to an interface:

>>> gp.Execute.__doc__
'IGeoProcessorResult Execute(self, str Name, IVariantArray ipValues, ITrackCance
l pTrackCancel)'

Anytime I do the following, my return object is unintialized:

result = gp.Execute(tool, parameters, None)

My question is how to I do this correctly? How would I get a result object that is initialized?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20061018/ca33667f/attachment.html>

More information about the Ironpython-users mailing list