Re: exporting classes in a DLL
- From: Alfonso Morra <sweet-science@xxxxxxxxxxxx>
- Date: Tue, 19 Jul 2005 13:47:38 +0000 (UTC)
Nishant Sivakumar wrote:
The class declaration header file should look something like this :-
#ifdef EXPORTSCLASS #define EXPORTCLASS_API __declspec(dllexport) #else #define EXPORTCLASS_API __declspec(dllimport) #endif
class EXPORTCLASS_API CMyClass { public: //... };
When you use this in the DLL project, define EXPORTSCLASS, but refrain from doing so in the EXE project where you call this dll.
Nishant, I tried this (exported a single method) and then run dumbin against my DLL. I find that the name of the method is mangled (as I had suspected).
Two questions:
If I declare a FAR PASCAL calling convention (i.e. declspec(export)) at the class level, do I get all the public methods exported "for free" or do I have to manually export every public method in the classes public interface?
2). If the names are mangled (ehich I suspect they will be because of the overloading etc I have in my code), can I still use the unmangled names of classes and methods in an application that links to the library?
tks
.
- Follow-Ups:
- Re: exporting classes in a DLL
- From: Alfonso Morra
- Re: exporting classes in a DLL
- References:
- exporting classes in a DLL
- From: Alfonso Morra
- Re: exporting classes in a DLL
- From: Rodrigo Corral [MVP]
- Re: exporting classes in a DLL
- From: Alfonso Morra
- Re: exporting classes in a DLL
- From: Nishant Sivakumar
- exporting classes in a DLL
- Prev by Date: Re: Open Com port failed (multi threading)
- Next by Date: Re: exporting classes in a DLL
- Previous by thread: Re: exporting classes in a DLL
- Next by thread: Re: exporting classes in a DLL
- Index(es):
Relevant Pages
|