#import "C:/Program Files/Common Files//ActiveX//test.dll" rename_namespace("testLib")/
rename("FreeSpace", "GxFreeSpace") rename("SendMessage","MySendMessage")
using namespace testLib;
int IninCom(void)
{
gb =NULL;
CLSID clsid;
HRESULT hr=CLSIDFromProgID(OLESTR("Genetec.test.7"),&clsid);
// 创建COM对象
hr = CoCreateInstance(clsid, NULL, CLSCTX_ALL,__uuidof(GxUIProxyVB),(LPVOID *)&gb);
if(FAILED(hr))
{
printf("create com failed! hr=0x%x", hr);
CoUninitialize();
return 0;
}
return 1;
}
请用OLE/COM对象查看器 观看 clsid 和 progID