Software & Finance





VC++ ATL/COM - Step 1 Creating COM Server DLL Component





 

1. Creating COM Server DLL Component

Open your Visual Studio 2005 editor and create a new project on Visual C++ and then select ATL Project.

 

 

Give the project name as SFTComServer. Click OK and move on to the next page. Then switch to Application Settings. For our example, the default settings would be perfect however you need to understand the difference between the options.

If the server type Dynamic Link Library, then your output would be a COM DLL component and will have an extension of .dll. And you need to use CLSCTX_INPROC_SERVER or CLSCTX_INPROC_HANDLER when you are creating your COM component from the client side.

If you have selected Executable (EXE), then output would be an application with .exe extension. And you need to use CLSCTX_LOCAL_SERVER when you are creating your COM component from the client side.

If you have selected the server type as Service and still the output would be an EXE and will act as a windows service.

The following is the screen shot of Application Settings.

 

 

 

Click here to download the complete source code of COM DLL Server, C++ Client and CSharp Client