Activate控件已经注册了,且注册表里有对应Com类,但是CoCreateInstance一直提示E——NOINTERFACE,求解
VS开发环境,Import进一个第三方控件,生成的tlh文件中有三个COM对象类,其中两个CoCreateInstance可以创建出实例能成功,第三个不行,求解。
生成的tlh文件中的三个类对象:
struct __declspec(uuid("cff9de8b-1ad5-4d25-a608-934886c8ff77"))
/* LIBID */ __IPModuleLib;
struct __declspec(uuid("8186bb24-fc1c-451e-bfbb-c8e3d0de5363"))
/* dispinterface */ _INetFinderEvents;
struct __declspec(uuid("f7133e54-3ed2-43a8-9329-cbf336885f4d"))
/* dual interface */ IIPMDevice;
enum SubPanelType;
enum IPMConfigResult;
struct /* coclass */ NetFinder;
struct __declspec(uuid("836403f8-e1b5-46ea-a865-13f0c173d322"))
/* dual interface */ INetFinder;
enum FindWay;
struct /* coclass */ IPMDevice;
struct __declspec(uuid("25363de5-9ea4-4014-b5bf-858eaae442f7"))
/* dispinterface */ _ICooMonitorEvents;
创建实例时:
CoCreateInstance(__uuidof(CooMonitor) , NULL, CLSCTX_INPROC_SERVER, __uuidof(ICooMonitor), (void**)&m_pCooMonitorPtr));//CooMonitor和NetFinder的可以成功,
CoCreateInstance(__uuidof(IPMDevice) , NULL, CLSCTX_INPROC_SERVER, __uuidof(_ICooMonitorEvents), (void**)&(m_pCooMonitorEventsPtr))一直提示E_NOINTERFACE的错误,注册表里类对象标示符IPMDevice对应的接口是_ICooMonitorEvents,求解!