Active Template Library (ATL) is a lightweight library used to develop COM-based components using Visual C++. Through ATL we can quickly develop COM components or COM services. In this article, I am trying to explain the steps to create an ATL COM component using Microsoft Visual C++ and Microsoft Visual Studio 2012 IDE (Integrated Development […]
COM – Creating a COM Component using C++ – IClassFactory implementation
CoCreateInstance depends on IClassFactory to create class instances. We have looked into IClassFactory‘s methods and we have implemented these methods in our previous article. Let’s include IClassFactory‘s implementation into our HelloComponent. We already have HelloComponent‘s declaration in the “HelloComponent.h” file and its implementation in the “HelloComponent.cpp” file. In the same way, we will add the IClassFactory […]
COM – Creating a COM Component using C++ – IClassFactory
In our previous article, we have identified that CoCreateFunction is requesting an instance of IClassFactory. Why CoCreateInstance is requesting an instance of IClassFactory? One of the goals of the COM is to locate the objects easily without worrying about where they are located and where they are housed; whether they are housed in in-process, local, or remote. in-process means, the […]
COM – Creating a COM Component using C++ – Inside CoCreateInstance
As we discussed in our previous articles, COM’s CoCreateInstance function is used to create instances for COM classes. What is happening inside the CoCreateInstance function? When the client program calls CoCreateInstance to create an instance of COM class: It actually internally calls another function CoGetClassObject CoGetClassObject checks the registry entries for CLSID which was passed through […]
COM – Creating a COM Component using C++ – .def file
In the previous article, we have created a test application to test our COM component. When we rant our test application, it was displaying a “Class not registered” error message. Before re-looking into our component and test application code; let’s understand in what scenarios this “Class not registered” error message occurred. One scenario is, unable to find […]
COM – Creating a COM Component using C++ – Registering a COM component
In our previous article, we have packaged a component into a DLL. Now we will look at how to register the component. Registering a COM component means, adding necessary registry entries into Windows Registry. COM library will pick up the component depending on the added registry entries and create an instance of it. Because of […]
COM – Creating a COM Component using C++ – DLL component
In this series of articles on creating a COM Component using C++, in the previous article, we have implemented a component using C++. The component implemented the IUnknown standard interface and IHello custom interface. Custom interfaces are the interfaces defined by us. Standard interfaces are the interfaces that are defined by the COM component library. We need […]
COM – Creating a COM Component using C++ – IUnknown interface definition
This is a series of articles explaining creating a COM component using C++. In our previous article, we defined an interface IHello and compiled the IDL file using Microsoft’s MIDL compiler. Now we are going to define a COM Component using C++. Remember that all the interfaces defined in an IDL file must be implemented. […]
COM – Creating a COM Component using C++ – IUnknown interface
COM – An introduction COM (Component Object Model) is a platform-independent, distributed, and object-oriented technology developed by Microsoft to create re-usable software components and enables software components to communicate. COM enables interaction between objects through interfaces. Interfaces are core concepts to build COM components. An interface contains function prototypes only not the function implementations. COM […]