Label: CoCreateInstance
CoCreateInstance is a core COM API function in Windows. It creates objects that expose COM interfaces. The function combines activation and interface retrieval in a single call. Developers pass a CLSID that identifies the COM class. They also provide an IID for the requested interface. COM then locates and loads the required server. The server can be an in-process DLL or an external EXE. Before calling the function, the thread must initialize COM with CoInitialize or CoInitializeEx. The function returns standard HRESULT error codes. CoCreateInstance is widely used by OLE, WMI, DirectShow, and Shell extensions.
Understanding COM activation helps with debugging and reverse engineering. It is also important for low-level Windows development.
21 Feb 2017
API DLL or COM object? Creating a COM object without registration
One of the major questions that an architector might face creating a multi-component project is how the components will interact. The mechanism of interaction could consist of COM interfaces usage and traditional import / export of functions and classes if we are talking about components that export a set of functions (in fact libraries). The way