Hello,
I think this is an easy question. When I create the objects, the event handler (ViewerEventImplementation in the example) is created by the factory by server.createInstance. I need to acces to the instance of ViewerEventImplementation that has been created in order to call some methods, stablish some properties, but I don't know how?. This ViewerEventImplementation is an extension of the EventsServer created automatically with the generation tool.
Manu thanks for all,
Manuel Crespo
Example:
container.createObject(Ax3dObj.CLASSID);
ax3dObjImpl = new IAx3dObjImpl(_container.getOleObject());
IClassFactoryServer server = new IClassFactoryServer(ViewerEventImplementation.class);
server.registerInterface(_IAx3dObjEventsImpl.class, new IDispatchVTBL(server));
server.setDefaultInterface(IDispatch.class);
IDispatchImpl handler = new IDispatchImpl();
server.createInstance(null, handler.getIID(), handler);
IConnectionPointContainer connectionPointContainer = new IConnectionPointContainerImpl(ax3dObjImpl);
IConnectionPoint connectionPoint = connectionPointContainer.findConnectionPoint(new IID(_IAx3dObjEventsImpl.INTERFACE_IDENTIFIER));
connectionPoint.advise(handler);
Hi Manuel,
There is the answer to this question in the ComfyJ Programmer's Guide: http://www.teamdev.com/downloads/comfyj/docs/ComfyJ-PGuide.html#Registering_Callbacks, though it may be not quite obvious; here is the example:
ViewerEventImplementation impl = (ViewerEventImplementation)server.getInstances().pop();
Please let me know if you have another question.
-Serge
Many thanks for the answer. Yes, you are right, hehe.
Regards