Actually Running a function from a DLL

Desaulniers, Peter Peter.Desaulniers at pahv.xerox.com
Mon Apr 10 14:30:23 EDT 2000


Writing C extensions for the first time is a daunting task.

The best source of information that I am aware of are:

1. The API is described, minimally, on the Python web site

2. Some of the python source header files have lengthy comments that explain
some important concepts.  

3. Internet Programming with Python by Watters, van Rossum and Ahlstrom has
a decent chapter on C extensions.  But you will still need to read the
headers indicated in #2.

Getting the call mechanism will be fairly straightforward with the above
information.  The challenge will be understanding object management.  The
proper use of INCREF and DECREF is a difficult concept to get right.
Improper INCREF may leak (maybe you don't care) and improper DECREF may
crash you due to a prematurely cleaned up reference (you will care about
that one).

In terms of how rapidly you can learn to do C extensions (that run correctly
on all systems... beware, want may work on Windows NT, no longer works on
Win2000 in some complex models), you may need to save your appetite unless
you have some really savvy developers. 

Good luck.

> -----Original Message-----
> From: Peter Olsen [mailto:pcolsen at draper.com]
> Sent: Friday, April 07, 2000 6:13 PM
> To: python-list at cwi.nl
> Subject: Actually Running a function from a DLL
> 
> 
> I'm writing ask for a quick explanation of how to load and 
> use dll files 
> from Python running under MS Windows.
> 
> I have installed PythonWin and win32all, but I seem to be completely 
> unable to run a function from a dll.  I'm loading the dll with 
> win32api.LoadLibrary, but I can't figure out how to access the 
> functions.  I've made some statements about how fast we can 
> learn Python 
> and the start development, but if I don't find an answer 
> quickly,  I may 
> have to eat my words.  If the best answer is "RTFM," please give me a 
> hint as to where in TFM I should R.
> 
> I would greatly appreciate receiving answers by email because 
> my company 
> makes it hard to read news.
> 
> Thanks!
> 
> Peter
> 
> 
> -- 
> http://www.python.org/mailman/listinfo/python-list
> 




More information about the Python-list mailing list