The information in this article applies to:
SYMPTOMSThere is no problem starting a second instance of a Win32-based application that uses a CWinApp-based DLL on Windows NT. However, under Win32s, the same Win32-based application generates an assertion failure in the file APPCORE.CPP, line 193. CAUSE
The inability to run two applications that use the same CWinApp-based DLL
is because of differences in the way Windows NT and Win32s manage memory
and the fact that the C run-time initializes global data and objects
whenever a process loads a DLL.
RESOLUTIONReplace the DLL entry point to work around the limitation. The sample code to do this is shown in the "MORE INFORMATION" section. The new entry point checks to see whether Win32s is loaded. If the application is running under Win32s, the entry point makes sure that the C run-time entry point is called only for the first process attach and the last process detach. This problem has been fixed in Microsoft Visual C++ 32-bit edition, versions 2.0 and 2.1. MORE INFORMATIONTo use this code as your new entry point, you need to change the entry point of your DLL to "NewDLLEntry()". Sample Code
You can still run into problems with memory allocation even after you have
replaced the entry point. Whichever process allocates the memory owns it;
therefore, when the process goes away, the object is destroyed and no other
process can use the object. This is a problem for any object shared by
multiple processes.
Additional query words: 1.00 2.00 2.10 noupdate
Keywords : kbDLL kbMFC kbVC |
Last Reviewed: January 20, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |