Load a 32-bit __stdcall library in 64-bit Python
This example shows how to access the 32-bit Windows kernel32 library from
64-bit Python. Kernel32
is the
32-bit server and Kernel64
is the
64-bit client.
Create a Kernel64
client to communicate
with the 32-bit kernel32 library
>>> from msl.examples.loadlib import Kernel64
>>> k = Kernel64()
>>> k.lib32_path
'C:\\Windows\\SysWOW64\\kernel32.dll'
Call the library to get the current date and time, see
get_local_time()
>>> k.get_local_time()
datetime.datetime(2021, 1, 21, 15, 29, 8, 482000)
Shutdown the 32-bit server when you are done communicating with the 32-bit library
>>> stdout, stderr = k.shutdown_server32()