CoCreateInstance for a 32 bit COM object doesn’t return in Windows 10 64 bit

  32-bit, 64-bit, activex, windows

I am trying to run a legacy Win32 app built with Delphi5 on Windows 10 64 bit. There are some COM objects in the form of dlls that need to be loaded at start up. However, when I try to load them, most of the time, not always though, the call in CoCreateInstance gets stuck indefinitely. I mean it just sits there. Sometimes, the objects are instantiated correctly and software does start up, so I believe registering isn’t an issue. This only happens on Windows 10, on my WIndows 7 64 bit PC, it never happens.

I have isolated the problem CreateComObject in ComObj.pas, but this may just be misleading because in the end it is the call the CoCreateInstance that never returns.

function CreateComObject(const ClassID: TGUID): IUnknown;
begin
  OleCheck(CoCreateInstance(ClassID, nil, CLSCTX_INPROC_SERVER or
    CLSCTX_LOCAL_SERVER, IUnknown, Result));
end;`

BTW, I tried setting the ThreadingModel to different values in registry but that doesn’t seem to solve the problem.

Does anyone have any idea how to resolve this? I would really appreciate any feedback as I am out of ideas at this time.

Source: Windows Questions

LEAVE A COMMENT