Re: How to wrap a existing DLL to a python module?

William S Fulton <[email protected]>
Newsgroups gmane.comp.programming.swig,gmane.comp.lib.boost.langbinding,gmane.comp.python.c++
Message-ID <[email protected]>
Bruce Who wrote:
> Hi,
> 
> Another question, what i do now is wrap all functions in DLL again like this:
> 
> // this is header file for DLL
> void func(void)
> {
>     ...
> }
> 
> // this is my .cpp file for swig
> #pragma comment(lib, "TEVlib.lib")
> 
> void _func(void)
> {
>     func() // this is the func of DLL
> }
> 
> // this is .i file
> %inline{
> extern void _func(void);
> %}
> 
> I just wonder if it is possible that we can generate a .py file
> directly from the header file of DLL with all functions exposed? I
> think that can save a lot of time. I have tried without success.
> 

Er, this is one of the things that SWIG is designed to do. Take a look
at %include.

William

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.