Click here to Skip to main content
15,881,882 members
Articles / Programming Languages / C#

Building COM Servers in .NET

Rate me:
Please Sign up or sign in to vote.
4.87/5 (95 votes)
2 Feb 2006CPOL98 min read 458.2K   4K   301  
Learn the fundamental principles of building COM DLL and EXE Servers using a .NET language.
========================================================================
    ACTIVE TEMPLATE LIBRARY : SimpleCOMObject_CPPImpl Project Overview
========================================================================

AppWizard has created this SimpleCOMObject_CPPImpl project for you to use as the starting point for
writing your Dynamic Link Library (DLL).

This file contains a summary of what you will find in each of the files that
make up your project.

SimpleCOMObject_CPPImpl.vcproj
    This is the main project file for VC++ projects generated using an Application Wizard. 
    It contains information about the version of Visual C++ that generated the file, and 
    information about the platforms, configurations, and project features selected with the
    Application Wizard.

SimpleCOMObject_CPPImpl.idl
    This file contains the IDL definitions of the type library, the interfaces
    and co-classes defined in your project.
    This file will be processed by the MIDL compiler to generate:
        C++ interface definitions and GUID declarations (SimpleCOMObject_CPPImpl.h)
        GUID definitions                                (SimpleCOMObject_CPPImpl_i.c)
        A type library                                  (SimpleCOMObject_CPPImpl.tlb)
        Marshaling code                                 (SimpleCOMObject_CPPImpl_p.c and dlldata.c)

SimpleCOMObject_CPPImpl.h
    This file contains the C++ interface definitions and GUID declarations of the
    items defined in SimpleCOMObject_CPPImpl.idl. It will be regenerated by MIDL during compilation.
SimpleCOMObject_CPPImpl.cpp
    This file contains the object map and the implementation of your DLL's exports.
SimpleCOMObject_CPPImpl.rc
    This is a listing of all of the Microsoft Windows resources that the
    program uses.

SimpleCOMObject_CPPImpl.def
    This module-definition file provides the linker with information about the exports
    required by your DLL. It contains exports for:
        DllGetClassObject  
        DllCanUnloadNow    
        GetProxyDllInfo    
        DllRegisterServer	
        DllUnregisterServer

/////////////////////////////////////////////////////////////////////////////
Other standard files:

StdAfx.h, StdAfx.cpp
    These files are used to build a precompiled header (PCH) file
    named SimpleCOMObject_CPPImpl.pch and a precompiled types file named StdAfx.obj.

Resource.h
    This is the standard header file that defines resource IDs.

/////////////////////////////////////////////////////////////////////////////
Proxy/stub DLL project and module definition file:

SimpleCOMObject_CPPImplps.vcproj
    This file is the project file for building a proxy/stub DLL if necessary.
	The IDL file in the main project must contain at least one interface and you must 
	first compile the IDL file before building the proxy/stub DLL.	This process generates
	dlldata.c, SimpleCOMObject_CPPImpl_i.c and SimpleCOMObject_CPPImpl_p.c which are required
	to build the proxy/stub DLL.

SimpleCOMObject_CPPImplps.def
    This module definition file provides the linker with information about the exports
    required by the proxy/stub.
/////////////////////////////////////////////////////////////////////////////

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Systems Engineer NEC
Singapore Singapore
Lim Bio Liong is a Specialist at a leading Software House in Singapore.

Bio has been in software development for over 10 years. He specialises in C/C++ programming and Windows software development.

Bio has also done device-driver development and enjoys low-level programming. Bio has recently picked up C# programming and has been researching in this area.

Comments and Discussions