Source Code Issues

Top 

The DTWAIN source code is written in C++ without using the support of the Microsoft Foundation Classes (MFC).  This allows as many compilers as possible to be able to compile the source, as well as not having to add other components to the overall size of the library.  If the user updates the source code, DynaRithmic Technologies cannot provide technical support for changes that the programmer(s) may make.  If there is a bug, a bug report must be sent to DynaRithmic Technologies.

 

The source code can be compiled in either a 16 or 32-bit environment by setting the appropriate compiler switches (this is specified in the source code).  There are no known problems building a 32-bit version of DTWAIN with any compiler that can build a DLL and has good C++ support (this includes exceptions, and a decent implementation of the Standard Template Library (STL))

 

There are issues with the 16-bit version.  The issues are as follows:

 

Compiling a 16-bit version of DTWAIN

The 16-bit version of DTWAIN must be compiled using a 16-bit C++ Windows compiler that supports C++ templates, including the STL (Standard Template Library).  The compiler that DTWAIN uses is the Symantec C++ compiler, version 7.5 using a special version of the STL specifically created for the Symantec compiler.  The 16-bit Microsoft compiler (Visual C++ 1.52 and below) cannot be used to recompile the source code since the Microsoft 16-bit compiler does not support templates.

 

Using the Borland Compiler to build a 16-bit DTWAIN DLL

The 16-bit compile modes for the Borland (now Inprise) compiler for versions 4.52 and above will compile a valid DTWAIN DLL that will work for most cases, but has the following problems when used with a Visual C++ 16-bit application that uses MFC:

 

The DTWAIN DLL must be loaded dynamically (using the Windows API LoadLibrary and GetProcAddress functions).  There are problems when the DTWAIN DLL is loaded automatically at program startup.   These problems have been traced to a bug in the Visual C++ 16-bit compiler and the internal MFC message map structure not being initialized properly at startup.   Because of this limitation, it is advised to use the special MFC DTWAIN class (CDTwain), since this class loads the library dynamically instead of statically.

 

There are no problems with the 32-bit version of DTWAIN with Visual C++ (Version 4 and above).