ZEMAX Users' Knowledge Base - http://www.zemax.com/kb
How to Compile a 64-bit DLL using Visual Studio 2008
http://www.zemax.com/kb/articles/300/1/How-to-Compile-a-64-bit-DLL-using-Visual-Studio-2008/Page1.html
By Tawnya Martin
Published on 24 June 2010
 
If you have developed a user-defined surface, object etc for ZEMAX, and need to recompile it to work with the 64-bit version of ZEMAX, it's easy. Changes need to be made to the source code to compile x32 or x64 compatible DLL’s. All that needs to change is a setting in the compiler.

Compiling to x32 and x64 platforms

If you have written a user-defined feature as a dll, you must compile two different versions, one for 32-bit versions of ZEMAX and the other for 64-bit ZEMAX. Fortunately, this is a simple task. No changes need to be made to the source code to compile x32 or x64 compatible DLLs. All that needs to change is a setting in the compiler. In Visual Studio 2008;

 

1. Go to Build > Configuration Manager

 

 

or, use the shortcut bar directly;

 

 

2. Under the Active Solutions Platform, select New;

 

 

 

This option should now be available to select under Active Solution Platform;

 

 

 

3. Select the platform you require then compile the DLL.  You may compile both 32 and 64 bit versions of the DLL using the same settings, same header and source files etc, by just toggling between the two options within this switch: