COM newbie here and appreciate any help/explanation. I have installed 32 bit COM type library on Windows 10 OS 64 bit.. When I am trying to access COM component on one of my test 32 bit dll everything works perfectly fine (VS2017).
#import "..\SDK_Location\SDKCOMLib.dll"
bool Connect()
{
HRESULT hr;
::CoInitialize(NULL);
COMLib::IConnectionPtr connection = NULL;
if (FAILED(hr = ::CoCreateInstance(__uuidof(COMLib::Connection), NULL, CLSCTX_ALL,
__uuidof(COMLib::IConnection), (void**)&connection)))
// or connection.CreateInstance(__uuidof(COMLib::Connection))))
{
std::cout << "Failed for \"Connection.CreateInstance\"! Error code: \"0x" << std::hex << hr << std::endl;
::CoUninitialize();
return false;
}
connection->Connect(data);
The same code used on our 32 bit project fails with 0x80040154 Class not registered error (same machine/ same project properties/ VS2017).
Any idea what can block access to that COM component on main project?
Thanks in advance
User contributions licensed under CC BY-SA 3.0