<p>Most of my C/C++ development involves monolithic module files and absolutely no classes whatsoever, so usually when I need to make a <strong>DLL</strong> with accessible functions I just export them using the standard <code>__declspec(dllexport)</code> directive.  Then access them either dynamically via <code>LoadLibrary()</code> or at compile time with a header and lib file. </p>

<p>How do you do this when you want to export an entire class (and all it's public methods and properties)?</p>

<p>Is it possible to dynamically load that class at runtime and if so, how?</p>

<p>How would you do it with a header and lib for compile time linking?</p>

I use some macros to mark the code for import or export
```
#ifdef ISDLL
#define DLL __declspec(dllexport)
#endif

#ifdef USEDLL
#define DLL __declspec(dllimport)
#endif
```
Then declare the class in a header file:
```
class DLL MyClassToExport { ... }
```
Then
```
#define ISDLL
```
in the libary, and
```
USEDLL
```
before including the header file in the place you want to use the class.
I don't know if you might need to do anything differently for working with
```
LoadLibrary
```