Reputation: 1
I am working on small program using com component on windows 10 1909, but I've got a problem with com function CLSIDFromProgID. The c++ code is as follows.
CoInitialize(NULL);
HRESULT hr = NULL;
CLSID clsid;
LPOLESTR pProgID = L"ProvisioningWapDPURemote";
hr = ProgIDFromCLSID(clsid, &pProgID);
I checked out that the progid exists in registry, but whenver I execute this code, ProgIDFromCLSID function returns invalid class string. What's more, when I get progid from clsid, the clsid I got is same as original one, I mean "ProvisioningWapDPURemote". I cannot find what the problem is. Could anyone help me?
Upvotes: -1
Views: 1522
Reputation: 595827
Your question mentions CLSIDFromProgID()
, but your code is calling ProgIDFromCLSID()
instead. You need to call the former, eg:
CLSID clsid;
LPOLESTR pProgID = L"ProvisioningWapDPURemote";
HRESULT hr = CLSIDFromProgID(pProgID, &clsid);
Upvotes: 0