Accessing dll

Helpful person rrllff at yahoo.com
Thu Sep 6 12:31:51 EDT 2012


On Sep 6, 8:28 am, Ulrich Eckhardt <ulrich.eckha... at dominolaser.com>
wrote:
> Am 06.09.2012 17:07, schrieb Helpful person:
>
> > I am a complete novice to Python.
>
> Welcome!
>
> > I wish to access a dll that has
> > been written to be compatible with C and VB6.  I have been told that
> > after running Python I should enter  "from ctypes import *" which
> > allows Python to recognize the dll structure.  I have placed the dll
> > into my active directory (if that's the correct word, one on my path)
> > for simplification.
>
> Using ctypes, you can indeed load DLLs. Take a look athttp://docs.python.org, which includes the documentation for the ctypes
> module but also general documentation and tutorials, which should be a
> starting point for you.
>
> > I tried:   "import name.dll" but this just gave me an error telling me
> > that there was no such module.
>
> Like in VB or C, things are not that easy. You will always have to write
> some code that informs Python about the names and parameters of the
> functions in that DLL.
>
> Good luck!
>
> Uli

Thanks.  I've been working my way through that page, so far without
any luck.  I'm still trying.

It seems strange that there is no documented way to simply access the
dll, even incorrectly!  If I could get Python to recognize the dll as
a module I would at least have a place to start debugging.



More information about the Python-list mailing list