Page 1 of 1

Com Creation

Posted: 29 Jun 2021 22:17
by sbishop61
I have used the comWrapper tool to create class and interfaces for an comDispInterface (automation) server.

The wrapped classes have zero arity constructors.
One of the classes returns an iDispatch object of the second class type. How do I create the class object from the iDispatch object?

class DVDoc
class app:getDVDoc : (integer NIndex) -> iDispatch Value.

I want to create the DVDoc object from the iDispatch returned.

Thanks,
Stephen

Re: Com Creation

Posted: 30 Jun 2021 9:48
by Thomas Linder Puls
Given that the object you "really" want is an iDVDoc object this is the safest code for your task:

Code: Select all

        IDisp = App:getDVDoc(Idx),         IDVDoc = comInterface::getFromUnknown(iDVDoc::iid, IDisp),         IDisp:release(),