logo       

accessing classes in a C++ DLL: msg#00000

python.ctypes

Subject: accessing classes in a C++ DLL

Is there any way to access a class that is exported by a DLL, or are we limited to using only extern C functions (as described by the article referred to by the FAQ on the ctypes website: http://sourceforge.net/mailarchive/forum.php?thread_id=1604647&forum_id=24606)

any suggestions for how to do this?

I'm thinking we'd have to rewrite the DLL to provide extern C access functions which then in turn create and use the classes - would the class objects have to stay *in* the DLL? in our case this should in fact be possible as the class provides very few functions and it should be possible to have the class created just for the purpose of calling those functions. But what would happen if the class took a long time to initialize (and was then efficient for subsequent function calls) and we didn't want to have every call to the function pay the penalty of that initialization?

I wouldn't think it's possible to get classes out of an 'extern C' DLL, but not being too knowledgeable in this area I thought I'd ask.

thanks,
Shi.


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise