Click here to Skip to main content
15,898,035 members
Home / Discussions / COM
   

COM

 
GeneralRe: Using DsoFramer.OCX Pin
Jetli Jerry11-Feb-05 2:51
Jetli Jerry11-Feb-05 2:51 
GeneralRe: Using DsoFramer.OCX Pin
vishalmore13-Feb-05 19:47
vishalmore13-Feb-05 19:47 
GeneralRe: Using DsoFramer.OCX Pin
Jetli Jerry13-Feb-05 20:20
Jetli Jerry13-Feb-05 20:20 
GeneralRe: Using DsoFramer.OCX Pin
vishalmore13-Feb-05 22:44
vishalmore13-Feb-05 22:44 
GeneralCOM DLL instantiated twice Pin
Pascal Pinchauret-Lamothe4-Feb-05 4:33
Pascal Pinchauret-Lamothe4-Feb-05 4:33 
GeneralRe: COM DLL instantiated twice Pin
rwestgraham6-Feb-05 11:50
rwestgraham6-Feb-05 11:50 
GeneralRe: COM DLL instantiated twice Pin
Pascal Pinchauret-Lamothe6-Feb-05 20:41
Pascal Pinchauret-Lamothe6-Feb-05 20:41 
GeneralRe: COM DLL instantiated twice Pin
rwestgraham7-Feb-05 0:22
rwestgraham7-Feb-05 0:22 
Well by their nature, ActiveX components instantiated from an HTML page ultimately run on the client, not the webserver. Assuming your MFC application is also running on the same client it should not be a DCOM issue.

If I understand what you are trying to do, basically you have two applications that you wish to subscribe to, and respond to, the same events raised from some class in an ActiveX component.

The fact that an ActiveX exe creates only one instance of the server itself does not entirely solve your problem. A single ActiveX exe server component can still create multiple instances of a given class.

For example, suppose your HTML page initially creates some object, "MyEventsClass" from the ActiveX componet (and thereby causes an instance of the ActiveX EXE to be launched). When your MFC application is launched, it requests an instance of the same "MyEventsClass" object. Since the server alrready exists, the same, single instance of the ActiveX EXE server will supply the MFC app with the class instance requested HOWEVER, it will not be the same instance of the class already supplied to the HTML page.

So with an ActiveX EXE you will no longer have two instances of the same component, but you will still have two instances of the class which both applications request - one instance for each application.

Assuming you want both applications to have a reference to a shared, single instance of the class created by the AtiveX component, first you will have to add code to ensure the class is created as singleton. If you code the object as a singleton, the first application to request the class from the ActiveX EXE will cause an instance of "MyEventsClass" to be created and the first app will receive a reference to the new instance. When the second application requests an instance of the same class, you have to have code that prevents the ActiveX EXE from creating a new instance. Instead the ActiveX EXE should just return a reference to the same instance the first app has already created. (I hope that makes sense).

The net result is that only the first application to request the class will receive a reference to a class that it instantiates. All subsequent requests for instances of the class will receive a reference to the same, single class instance that has already been created by the first request.

If this is what you want to happen, coding a singleton class is not difficult - you just create a mutex, and check in the class constructor if the mutex already exists. If so, the constructor returns a reference to the already existing class instance to the second client app that requests the object.

Now, getting both apps to sink the same events from a single, shared instance of a class may be a different story, because ATL is essentially templates that hide a lot of the COM architecture in macros.

My understanding of the intricacies of what happens in the ATL COM wrapper framework is not extensive enough to speculate on what is required to sink the same set of events from a ActiveX EXE in two different apps.

I would suggest that you refine your question and post it on the ATL forum and see if some ATL guru can provide you with the details.

Sorry, that is about as much info as I can provide ...

Good Luck!

Robert




GeneralRe: COM DLL instantiated twice Pin
Pascal Pinchauret-Lamothe7-Feb-05 21:33
Pascal Pinchauret-Lamothe7-Feb-05 21:33 
GeneralRe: COM DLL instantiated twice Pin
rwestgraham8-Feb-05 9:02
rwestgraham8-Feb-05 9:02 
GeneralRe: COM DLL instantiated twice Pin
Pascal Pinchauret-Lamothe8-Feb-05 10:57
Pascal Pinchauret-Lamothe8-Feb-05 10:57 
GeneralRe: COM DLL instantiated twice Pin
engrx221-Sep-07 5:41
engrx221-Sep-07 5:41 
GeneralQuestion about [in, out] parameters Pin
AndyCheetham4-Feb-05 2:43
AndyCheetham4-Feb-05 2:43 
GeneralRe: Question about [in, out] parameters Pin
Mike Dimmick7-Feb-05 0:00
Mike Dimmick7-Feb-05 0:00 
GeneralRe: Question about [in, out] parameters Pin
Jörgen Sigvardsson8-Feb-05 9:55
Jörgen Sigvardsson8-Feb-05 9:55 
GeneralCOM + several classes Pin
Geert van Horrik3-Feb-05 22:52
Geert van Horrik3-Feb-05 22:52 
GeneralCom components Pin
masud_masud3-Feb-05 4:25
masud_masud3-Feb-05 4:25 
QuestionATL ActiveX - How to create the own Property Page? Pin
out_of_life3-Feb-05 0:02
out_of_life3-Feb-05 0:02 
AnswerRe: ATL ActiveX - How to create the own Property Page? Pin
out_of_life4-Feb-05 1:54
out_of_life4-Feb-05 1:54 
GeneralRTD (real Time Data) problem Pin
aswanee2-Feb-05 2:02
aswanee2-Feb-05 2:02 
General"A Tool returned Error" Pin
Hariharan.T1-Feb-05 21:31
Hariharan.T1-Feb-05 21:31 
General0x8000401a - The server process could not be started because the configured identity is incorrect. Check the username and password. Pin
ohadp1-Feb-05 20:48
ohadp1-Feb-05 20:48 
GeneralDeriving a class from more than one interface Pin
Steve Thresher31-Jan-05 23:24
Steve Thresher31-Jan-05 23:24 
GeneralRe: Deriving a class from more than one interface Pin
AndyCheetham4-Feb-05 3:00
AndyCheetham4-Feb-05 3:00 
GeneralSink implementation Pin
Hariharan.T31-Jan-05 0:26
Hariharan.T31-Jan-05 0:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.