下面是我的代码,是不是OPC服务器主机的配置问题还是我访问机的问题?小弟OPC新手,望各位前辈不吝赐教。
CoInitialize(NULL);
HRESULT hr;
COSERVERINFO si;
wchar_t ip_add[] = L"192.168.0.102";
ZeroMemory(&si, sizeof(si));
si.pwszName = ip_add;
MULTI_QI mqi[1];
mqi[0].hr = S_OK;
mqi[0].pIID = &IID_IOPCServerList;
mqi[0].pItf = NULL;
IOPCServerList *pIServerList = NULL;
hr = CoCreateInstanceEx(
CLSID_OPCServerList,
NULL,
CLSCTX_ALL,
&si,
1,
mqi);
pIServerList =(IOPCServerList *) mqi->pItf;
hr返回没有注册接口