COMP: Improve Visual Studio DLL exports.

The WIN32 macro is not officially defined by the compiler--
use _WIN32 on _MSC_VER instead.  Also, use GenerateExportHeader
macro from CMake to get a better, future proof export header.