Skip to content Skip to sidebar Skip to footer

Register A 32-bit Com Class For Use In 64-bit Python Without Administrator Rights

I'm making a Python script that uses SAP's GUI scripting API through win32com. The first usage is like this: from win32com.client import Dispatch objWrapper = Dispatch('SapROTWr.Sa

Solution 1:

A 64-bit process cannot directly load a 32-bit in-process COM server (ie, a DLL), and vice versa, for obvious reasons (ie, a mismatch in bitness).

MS Office apps are not in-process servers, they are out-of-process servers (ie, they run in their own EXEs), so they do not suffer from this problem. COM can be used across process boundaries without regard to the bitness of each process, as calls into/out of a COM object are marshaled as needed.

And yes, a COM Surrogate is the way to work around this issue for an in-process server, by wrapping it inside of an out-of-process proxy server that is provided by the OS.

Post a Comment for "Register A 32-bit Com Class For Use In 64-bit Python Without Administrator Rights"