Using dllimport and dllexport in C++

You can declare C++ classes with the dllimport or dllexport attribute. These forms imply that the entire class is imported or exported. Classes exported this way are called exportable classes.

The following example defines an exportable class. All its member functions and static data are exported:

#define DllExport   __declspec( dllexport )

class DllExport C
{
   int i;
   virtual int func( void )
   { return 1; }
};

Note that explicit use of the dllimport and dllexport attributes on members of an exportable class is prohibited.