All-In-One COM Code Samples

 

 

Introduction

Microsoft COM (Component Object Model) technology in the Microsoft Windows-family of Operating Systems enables software components to communicate. COM is used by developers to create re-usable software components, link components together to build applications, and take advantage of Windows services. COM objects can be created with a variety of programming languages. Object-oriented languages, such as C++, provide programming mechanisms that simplify the implementation of COM objects. The family of COM technologies includes COM+, Distributed COM (DCOM) and ActiveX® Controls.

The All-In-One COM code samples demonstrate the typical programming topics about COM. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration felt by developers when they are developing COM projects.

Code Sample Graph

 

Visual Studio 2008 Code Samples

Sample Description Download ReadMe
ATLActiveX An ATL ActiveX Control Download ReadMe.txt
ATLCOMClient Use COM servers in an ATL application Download ReadMe.txt
ATLCOMService An out-of-process ATL COM Service Download ReadMe.txt
ATLDllCOMServer An in-process ATL COM Server Download ReadMe.txt
ATLExeCOMServer An out-of-process ATL COM Server Download ReadMe.txt
CppCOMClient Use COM servers in a C++ application Download ReadMe.txt
CppDllCOMServer In-proc COM Server made in C++ Download ReadMe.txt
CppRegFreeCOMClient Reg-free activate COM from C++ Download ReadMe.txt
CppRegisterTypeLib Register type library (C++) Download ReadMe.txt
CSActiveX A C# ActiveX Control Download ReadMe.txt
CSCOMClient Host ActiveX controls and use COM servers in a C# application Download ReadMe.txt
CSCOMService An out-of-process COM Service in C# Download ReadMe.txt
CSDllCOMServer An in-process COM server in C# Download ReadMe.txt
CSExeCOMServer An out-of-process COM Server in C# Download ReadMe.txt
CSRegFreeCOMClient Reg-free COM Client in C# Download ReadMe.txt
CSRegFreeCOMServer Reg-free COM Server in C# Download ReadMe.txt
CSServicedComponent A serviced component written in C# Download ReadMe.txt
HTMLEmbedActiveX Host ActiveX controls in HTML Download ReadMe.txt
MFCActiveX A MFC ActiveX Control Download ReadMe.txt
MFCCOMClient Host ActiveX controls and use COM servers in a MFC application Download ReadMe.txt
MFCSafeActiveX A MFC ActiveX Control Safe for Scripting and Initialization Download ReadMe.txt
VBActiveX A VB ActiveX Control Download ReadMe.txt
VBCOMClient Host ActiveX controls and use COM servers in a VB application Download ReadMe.txt
VBDllCOMServer An in-process COM server in VB Download ReadMe.txt
VBExeCOMServer Out-of-proc COM Server made in VB Download ReadMe.txt
VBRegFreeCOMServer Reg-free COM Server in VB Download ReadMe.txt
VBServicedComponent A serviced component written in VB Download ReadMe.txt

 

Download all code samples: http://1code.codeplex.com/releases

 

Submit your request of COM code samples (Guidance)

Last edited Jan 23, 2011 at 10:37 AM by Jialiang, version 24

Comments

maheshb2487 Sep 24, 2012 at 8:17 AM 
Is it possible to get a call flow diagram kinda ? when client calls CreateInstance function with the classId, how does it locate and load the Dll ? or the DLL is loaded even before a call to CreateInstance ? when does DLLGetClassObject get invoked ?

ksnavinkumar Apr 6, 2011 at 5:42 AM 
Thanks for ALL IN ONE CODE SAMPLE Team for valuable help

Thanks
ksnavinkumar@live.com