[Pyrex] Creating a DLL with Pyrex.

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Nov 9 01:42:33 CET 2004


Blake Winton wrote:
> My research indicates that I need to wrap the library with another C-based wrapper

More precisely, you need a C++ wrapper that exposes
a C-callable interface.

> Anyways, a sample C++ function definition would be
> long CSyncRegisterConduit      (CONDHANDLE &) 
> And I've translated it into C as:
> long CSyncRegisterConduit      (CONDHANDLE *) ;

You'll need to declare it as

   extern "C" long CSyncRegisterConduit(CONDHANDLE *);

so that the C++ compiler will make it callable
from C.

> And then my implementation would look like:
> long CSyncRegisterConduit( CONDHANDLE* p1 ) {
>     return SyncRegisterConduit( *p1 );
> }

That looks right, I think.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+




More information about the Pyrex mailing list