i have some class with a few methods inside.
those method used by external program (as a dll).
how should i declare those class methods so i can use it outside??
another question is it possible to declare the all class as import or export??
When you build the dll, you have to declare the class for export using
__declspec(dllexport).
When you use the dll, you have to declare the class with __declspec(dllimport)
You can use a construct like this:
#ifdef BUILDING_DLL
#define IMPEXP __declspec(dllexport)
#else
#define IMPEXP __declspec(dllimport)
#endif
class IMPEXP CMyClass
{
//...
};
If you build the dll, you have to define BUILDING_DLL in your precompiled
header or your project settings, so the class will be exported.
when you use the dll, this macro should not be defined, and the class will
be imported.
of course you still have to link your app against the lib file of the dll so
that the linker knows where it can find the the class.
--
Kind regards,
Bruno.
br**********************@hotmail.com
Remove only "_nos_pam"