On 6/6/21, pjfarl...@earthlink.net <pjfarl...@earthlink.net> wrote: > > On a Windows 10 platform (python 3.8.9 and 3.9.5), how do I use ctypes to > access an array of uint32_t's exported from a DLL? > ... > __declspec(dllexport) extern uint32_t array_name[128];
A ctypes data type has an in_dll() method [1] that returns an instance of the type that references data in a shared library (DLL). It takes a CDLL instance for the shared library and the exported symbol name. For example: data = (ctypes.c_uint32 * 128).in_dll(library, "array_name") --- [1] https://docs.python.org/3/library/ctypes.html#ctypes._CData.in_dll -- https://mail.python.org/mailman/listinfo/python-list