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?
Your question mentions
CLSIDFromProgID()
, but your code is callingProgIDFromCLSID()
instead. You need to call the former, eg: