摘要:
今天碰到这种情况:需要重新注册某个COM组件,但是在注册前希望可以检测当时组件是否可用,1 CLSID const clsid = {XXX};2 LPUNKNOWN pUnknow = NULL;3 const LRESULT lr = ::CoCreateInstance(clsid,NULL,CLSCTX_ALL,IID_IUnknown,(LPVOID*)&pUnknow);4 if(lr!=REGDB_E_CLASSNOTREG && NULL!=pUnknow){5 bRes = TRUE;6 }7 if(pUnknow){8 pUnknow->Rel 阅读全文