This topic describes two common problems that can occur when thunking is implemented, and describes their likely causes.
The Windows 95 loader requires that the 16-bit DLL be marked with version 4.0 or later. In addition, you must mark DllMain with the RESIDENTNAME modifier.
To check the version number, run the Microsoft EXE File Header Utility (EXEHDR), using the following command line:
exehdr -v <your-16-bit-DLL>
The output should contain the following line:
Operating system: Microsoft Windows - version 4.0
If the version number is earlier than 4.0, you should use RC.EXE from the Platform SDK to set the version of your 16-bit DLL correctly.
This is by design. A 32-bit DLL does not load into a process context until that process calls its first 16-bit to 32-bit thunk. For more information, see Late Loading.
If this feature is incompatible with your DLL design, you may disable it by including the following line in your thunk script.
preload32 = true;