问题描述:
    CoCreateInstance函数的第一个和第四个参数是怎么确定的呢,我都不知道怎么来的。指教一下。

解决方案 »

  1.   

    STDAPI CoCreateInstance(
      REFCLSID rclsid,     //Class identifier (CLSID) of the object
      LPUNKNOWN pUnkOuter, //Pointer to whether object is or isn't part 
                           // of an aggregate
      DWORD dwClsContext,  //Context for running executable code
      REFIID riid,         //Reference to the identifier of the interface
      LPVOID * ppv         //Address of output variable that receives 
                           // the interface pointer requested in riid
    );
    一个是组件类的GUID,一个是接口的GUID!
      

  2.   

    需要研究一下 COM 技术。
      

  3.   

    STDAPI CoCreateInstance(
      REFCLSID rclsid,     //Class identifier (CLSID) of the object
      LPUNKNOWN pUnkOuter, //Pointer to whether object is or isn't part 
                           // of an aggregate
      DWORD dwClsContext,  //Context for running executable code
      REFIID riid,         //Reference to the identifier of the interface
      LPVOID * ppv         //Address of output variable that receives 
                           // the interface pointer requested in riid
    );
    一个是组件类的GUID,一个是接口的GUID!
    //////////////////////////当我要使用一个COM接口的时候
    我怎么知道该组件类的GUID和接口的GUID分别是什么呢