Loading the local msvcrt.dll instead of the system one
Posted on 2000-03-01
I am experiencing problems with an MFC executable built in VC6. It needs to make use of DLLs that were built with VC4.1. I am getting Access Violations at odd times, and I strongly suspect that there is an incompatibility between the exe and the DLLs that is causing heap corruption somehow - a couple of MSDN articles mention that this can happen when VC6 and VC4 programs share the same VC4 version of msvcrt.dll.
What I notice is that the VC6 executable, even though it has the msvcrt.dll version 6 in its local directory, is nevertheless using the msvcrt.dll version 4 that is in the system directory. Other processes are using the version 4 DLL. What I want is to make my VC6 program use the VC6 msvcrt.dll that is in its directory.
I understand that normally, even if DLL 'X' is loaded in a process, another process will still load its local version of DLL 'X'. Is this different for msvcrt.dll? Is there a way around this? I am using NT Server 4.