dcsimg
Please help! A problem with JavaBeans ActiveX Bridge.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Free_Operator
Posted On:   Thursday, August 2, 2001 01:34 AM

Dear all, I was assigned a task to replace an existing MFC ActiveX control with a JavaBean. My JavaBean is being developed under Forte4Java. Although the Java Plug-in allows me to wrap my JavaBean component as an ActiveX contorol, there is still one problem that I can't get around. In the code of the ActiveX control, an instance of a MFC DLL component is created. Moreover, this ActiveX control passes its IDispatch interface using CCmdTarget::GetIDispatch( ) to the DLL component instances it creates. Likewise, in the code of that DLL component, an instance of this ActiveX control is created. Upon receiving the IDispatch interface of the calling ActiveX control, the DLL component will use COleDispatchDriver::AttachDispatch( )   More>>

Dear all,


I was assigned a task to replace an existing MFC ActiveX control with a JavaBean. My JavaBean is being developed under Forte4Java. Although the Java Plug-in allows me to wrap my JavaBean component as an ActiveX contorol, there is still one problem that I can't get around.


In the code of the ActiveX control, an instance of a MFC DLL component is created. Moreover, this ActiveX control passes its IDispatch interface using CCmdTarget::GetIDispatch( ) to the DLL component instances it creates. Likewise, in the code of that DLL component, an instance of this ActiveX control is created. Upon receiving the IDispatch interface of the calling ActiveX control, the DLL component will use COleDispatchDriver::AttachDispatch( ) to attach this IDispatch interface to the ActiveX control instance it creates. This way, a 2-way communication channel can be created between the caller ActiveX control and the callee DLL component -- the caller ActiveX control instance can access those various methods/properties of the callee DLL component instance and the callee DLL component can also access those methods/properties of the caller ActiveX control. They are actually the client and server of each other at the same time.


Now it comes to JavaBean, I have already succeeded in creating an instance of that DLL component in my JavaBean and it should not be a problem for the DLL component to create an instance of my JavaBean component. But I don't know how to find the equivalent mechanism for passing and attaching the IDispatch Interface of the ActiveX control? Does JavaBean object also have an IDispatch interface or something similiar so that I can pass it to the DLL component? If not, is there any other way to achieve the same result with JavaBean? Please advise and thanks in advance...

   <<Less
About | Sitemap | Contact