> -----Original Message-----
> From: Eryk Sun <eryk...@gmail.com>
> Sent: Monday, June 7, 2021 12:34 PM
> To: python-list@python.org
> Cc: pjfarl...@earthlink.net
> Subject: Re: ctypes on Windows question: How to access an array of uint32_t
> exported from a DLL?
> 
> 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")

Thanks for the help.  I just didn't see this kind of simple case demonstrated 
on the ctypes doc page.

I guess I am just a bit dense.  Mea culpa.  Anyway, thanks again.

Peter
--


-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to