how to export functions by name for ctype

R

rych

I'm on Windows with VS2005 testing ctypes on a very simple dll
I create a test.dll project which exports a function fntest(). I don't
touch anything in the autogenerated source and build it. I can load
the dll but can't access the function by its name fntest. Only by
ordinal number or calling getattr with "?fntest@@YAHXZ". How do I
export functions by name? It's probably rather a VS2005 question, but
I'm a bit disappointed ctypes doesn't work with a default export
convention.
 
R

rych

I guess you've compiled your DLL with C++ and the above is a C++
mangled name.

Either compile it with C, or export the names in an extern "C" { }
block.

That fixed it, thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top