CMyComPtrmyPtr = new CMyComObject(); myPtr.Release();
CMyComPtrIn this example, we create a smart pointer for the IXMLDOMDocument interface and initialize it with a new instance of the DOMDocument COM object. We then release the reference count of the object using the Release function. Package library: It is likely that the package library being used in these examples is the Microsoft Active Template Library (ATL), which provides a set of C++ classes for developing COM-based software. The CMyComPtr class is part of the ATL library and is used to manage the reference counting of COM objects.xmlDoc; CoCreateInstance(__uuidof(DOMDocument), NULL, CLSCTX_INPROC_SERVER, __uuidof(IXMLDOMDocument), (void**)&xmlDoc); xmlDoc.Release();