COM Object GUID missing

376 Views Asked by At

I want to connect to a running object using COM. I have this code.

  CLSID clsid;
  CLSIDFromProgID(L"CSI.ETABS.API.ETABSObject", &clsid);

  // get the active ETABS object
  CComPtr<IUnknown> pUnk;
  auto hRes = GetActiveObject(clsid, NULL, (IUnknown**)&pUnk);
  if(!CheckHRESULT(hRes, L"Cannot get active ETABSObject!")) return (hRes);
  hRes = pUnk->QueryInterface(__uuidof(ETABSv17::cOAPI), (void **) &pETABSObject);
  if(!CheckHRESULT(hRes, L"Cannot attach to ETABSObject!")) return (hRes);

However the compiler complains that no GUID is assocaited with ETABS:cOAPI. How to resolve this issue ?

exact error message is: can not call operator __uuidof on object with no guid.

0

There are 0 best solutions below