I just wanted to add, from more reading, all the examples that point to what
I want to do seem to involve registering a new class as a COM component.
The thing is, I only really want to use this in the same client, as that
which dispatched the object.  I don't need a server here and would like to
avoid registering a new COM component just for that purpose.  In C++ I see
this is can be done by simply creating a subclass of ISomeInterface, and it
seems to work off the bat.  You can create an instance of it, and use it as
needed.

Can something similar be done with comtypes?  Is registering a COM server
the only way to go?

Basically I want to do something like this:

import comtypes.client as cc
import comtypes.gen.ExampleLib

class ISomeInterface_Impl(ExampleLib.ISomeInterface):
    # This is the concrete implementation of ExampleLib.ISomeInterface
    pass

# --

# Dispatch the COM application
obj = cc.CreateObject(ExampleLib.MainApp)

# Create instance of my own implementation of ISomeInterface
myimpl = ISomeInterface_Impl()

# Here I want to pass my own implementation of ISomeInterface as a parameter
to a method of MainApp
obj.SomeMethod(myimpl)


At this point, I'm not sure how I can define the class ISomeInterface_Impl
to do the above.

Thanks!
Eddie
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to