扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
CComPtr<IMyInterface> spMyInterface; spMyInterface.CoCreateInstance(); //register interface in global interface table CComPtr<IGlobalInterfaceTable> spGIT; spGIT.CoCreateInstance(CLSID_StdGlobalInterfaceTable); if (spGIT) { spGIT->RegisterInterfaceInGlobal(spMyInterface, IID_IMyInterface, &m_dwCookie); } |
CComPtr<IMyInterface> spMyInterface; if (m_dwCookie!=0) { CComPtr<IGlobalInterfaceTable> spGIT; spGIT.CoCreateInstance(CLSID_StdGlobalInterfaceTable); if (spGIT) { spGIT->GetInterfaceFromGlobal(m_dwCookie, IID_IMyInterface, (void**)&spMyInterface.p); } } if (spMyInterface) { //Call my interface } |
if (m_dwCookie!=0) { CComPtr<IGlobalInterfaceTable> spGIT; spGIT.CoCreateInstance(CLSID_StdGlobalInterfaceTable); if (spGIT) { spGIT->RevokeInterfaceFromGlobal(m_dwCookie); m_dwCookie = 0; } } |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。