WEB开发网
开发学院软件开发VC 编写在浏览器中不弹出警告的ActiveX控件 阅读

编写在浏览器中不弹出警告的ActiveX控件

 2006-07-22 22:02:53 来源:WEB开发网   
核心提示: HRESULT RegisterCLSIDInCategory(REFCLSID clsid, CATID catid){// Register your component categories information.ICatRegister* pcr = NULL ;HRESULT
HRESULT RegisterCLSIDInCategory(REFCLSID clsid, CATID catid)
{
  // Register your component categories information.
  ICatRegister* pcr = NULL ;
  HRESULT hr = S_OK ;
  hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr,
        NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr);
  if (SUCCEEDED(hr))
  {
    // Register this category as being "implemented" by the class.
    CATID rgcatid[1] ;
    rgcatid[0] = catid;
    hr = pcr->RegisterClassImplCategories(clsid, 1, rgcatid);
  }
  if (pcr != NULL)
    pcr->Release();
  return hr;
}

// 卸载组件种类

HRESULT UnRegisterCLSIDInCategory(REFCLSID clsid, CATID catid)
{
  ICatRegister* pcr = NULL ;
  HRESULT hr = S_OK ;
  hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr,
      NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&pcr);
  if (SUCCEEDED(hr))
  {
    // Unregister this category as being "implemented" by the class.
    CATID rgcatid[1] ;
    rgcatid[0] = catid;
    hr = pcr->UnRegisterClassImplCategories(clsid, 1, rgcatid);
  }
  if (pcr != NULL)
    pcr->Release();
  return hr;
}

// DllRegisterServer - Adds entries to the system registry

Tags:编写 浏览器 警告

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接