Using AFX EXT DLL ATL objects in ATL EXE server 
Author Message
 Using AFX EXT DLL ATL objects in ATL EXE server

I am in the process of converting an ATL DLL COM server into an ATL EXE COM
server. I am trying to resue the same code base from the COM DLL (which we
still want to maintain as an entity), therefore, my idea was to make an AFX
EXT DLL that is NOT a COM server, but holds all of the same COM objects as
my COM DLL. I moved all of the IDL into my EXE and created the OBJECT MAP
and _Module object in the EXE. I am hoping to be able for the EXE to access
the COM objects in the AFX EXT DLL in order to process the interface calls
that come into the EXE.

I had to create a global _Module object in the non-COM DLL in order to get
it to link. Not sure if this is going to work or conflict with the _Module
deifned in the EXE?

My main question is:

Where can I get an example or documentation on how to build a COM EXE server
that stores it's underlying COM objects in a non-COM DLL?

Thank You!



Tue, 23 Dec 2003 23:10:40 GMT  
 Using AFX EXT DLL ATL objects in ATL EXE server
That's not going to work and the reason is - lifetime management.
You have to not define _Module in the DLL, but instead export it
from the EXE (!!!) and use the importlib generated by the EXE to
link the DLL. VERY weird! Of course the DLL is tightly coupled with
the EXE and is not reusable... Besides, you have to change the
RGS files in the DLL. That's definitely not the approach I'd have
taken...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> I am in the process of converting an ATL DLL COM server into an ATL EXE
COM
> server. I am trying to resue the same code base from the COM DLL (which we
> still want to maintain as an entity), therefore, my idea was to make an
AFX
> EXT DLL that is NOT a COM server, but holds all of the same COM objects as
> my COM DLL. I moved all of the IDL into my EXE and created the OBJECT MAP
> and _Module object in the EXE. I am hoping to be able for the EXE to
access
> the COM objects in the AFX EXT DLL in order to process the interface calls
> that come into the EXE.

> I had to create a global _Module object in the non-COM DLL in order to get
> it to link. Not sure if this is going to work or conflict with the _Module
> deifned in the EXE?

> My main question is:

> Where can I get an example or documentation on how to build a COM EXE
server
> that stores it's underlying COM objects in a non-COM DLL?

> Thank You!



Wed, 24 Dec 2003 06:09:08 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. using MFC Extension DLL from ATL server(exe)

2. Using a ATL Object in another ATL Object

3. Using a ATL Object in another ATL Object

4. Calling Exe server from Dll(ATL)

5. New to ATL Please Help - Navigating Interface with two types of server (Exe and Dll)

6. Problems using a ATL COM EXE Server with VB Client

7. Creating Automation Server Exe using ATL

8. Using CString in an ATL Wizard generated EXE server, VC 5.0

9. Can't add more than one ATL object to an ATL project using wizard

10. AFX managing states in an ATL Object

11. AFX managing states in an ATL Object

12. Using CString in ATL dll server.

 

 
Powered by phpBB® Forum Software