ctypes on Windows question: How to access an array of uint32_t exported from a DLL?

pjfarley3 at earthlink.net pjfarley3 at earthlink.net
Mon Jun 7 00:04:46 EDT 2021


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?

 

The array (after various #define's are resolved) is defined as:

 

__declspec(dllexport) extern uint32_t array_name[128];

 

I have read and re-read the ctypes documentation and I am still confused
about how to access the exported array (read only, not for modification)
from a python script.

 

The DLL is successfully accessed and functions from it are usable after
executing syntax similar to this:

 

extlib = ctypes.CDLL(dllpath)

 

Where "dllpath" is a fully-qualified path to the DLL.

 

TIA for any help you can provide.

 

Peter

--



More information about the Python-list mailing list