Customer calls COM process

Source: Internet
Author: User

Reference: COM Technology Insider

DllGetClassObject
Https://msdn.microsoft.com/en-us/library/windows/desktop/ms680760.aspx
If a call to the CoGetClassObject function finds the class object which is the loaded in a DLL,
CoGetClassObject uses the DLL ' s exported dllgetclassobject function.

IClassFactory
Https://msdn.microsoft.com/en-us/library/windows/desktop/ms694364.aspx
After calling the CoGetClassObject function to get a IClassFactory interface pointer to the class object,
Call the CreateInstance method of this interface to create an object.

CoCreateInstance
Https://msdn.microsoft.com/en-us/library/windows/desktop/ms686615.aspx
CoCreateInstance equivalence
{
CoGetClassObject (Rclsid, dwClsContext, NULL, Iid_iclassfactory, &pcf);
HRESULT = Pcf->createinstance (Punkouter, riid, ppvobj
Pcf->release ();
}

CoGetClassObject: The specified component will be found in the registry. Once found, it will load the DLL that implements this component.
After the mount succeeds, it calls the DllGetClassObject implemented in the DLL server.
DllGetClassObject: The function is to create a response class farm.
Queries the IClassFactory interface and returns it to CoCreateInstance.
CoCreateInstance will use this interface to invoke the IClassFactory::CreateInstance function
IClassFactory::CreateInstance invokes the new operator to create the specified component and queries the component's IX interface.

The customer calls the COM process:
Cocreateinstace (Rclsid,null,dwclscontext,iid_ix, (void**) &pix); ix* PIX
|--> CoGetClassObject (Rclsid, dwClsContext, NULL, Iid_iclassfactory, &pcf)//iclassfactory* PCF
|--> DllGetClassObject (RCLSID,IID_ICLASSFACTORY,&PCF)
|--> cfactory* pfactory = new CFactory ();
|--> Pfactory->queryinterface (IID_ICLASSFACTORY,&PCF); Returns the class field pointer iclassfactory* PCF
|--> pcf->createinstance (Punkouter, Iid_ix, &pix); ix* PIX Component Interface pointer pix
Pix->fx ();

Note:. def module definition files

LIBRARY "Comcomponent"

Exports
DllCanUnloadNow PRIVATE
DllGetClassObject PRIVATE
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE

Customer calls COM process

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.