Passing custom interface pointer
Posted on 2003-11-03
I have an ATL exe project which exposes a COM object.The aim is to return the interface pointer of another COM object as the return of a method call.
So if I have 2 COM objects
1.ObjInvoked housed in a DLL,exposing a custom interface IObjWire
2.ObjInvoker housed within the ATL exe project,contains a method GetpIf(IObjwire** ptr).
This idl imports the idl of the Dll to allow a successful compilation/linking of the project.
Now when a client tries to instantiate ObjInvoker it fails.However,if i change the GetIpf to return IUnknown**,the object is invoked successfully.
Is the presence of a custom interface in the method semantics causing th efailure in instantiation?If so,is there some legal way to make the return of a custom interface pointer possible?