当前模块目录下的dll应该是最优先加载的吧
我把msvcrt.dll 复制到exe目录下,为什么他还是加载system32的那个版本?

解决方案 »

  1.   

    一般:The directory from which the application loaded. 
    The current directory. 
    Windows 95/98: The Windows system directory. Use the GetSystemDirectory function to get the path of this directory. 
    Windows NT/ 2000: The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is SYSTEM32. Windows NT/ 2000: The 16-bit Windows system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is SYSTEM. 
    The Windows directory. Use the GetWindowsDirectory function to get the path of this directory. 
    The directories that are listed in the PATH environment variable. 有些系统的DLL会强制从系统目录下加载(安全缘故)
      

  2.   

    一般:1.The directory from which the application loaded.  
    2.The current directory.  
    3.Windows 95/98: The Windows system directory. Use the GetSystemDirectory function to get the path of this directory.  
    Windows NT/ 2000: The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is SYSTEM32.  4. Windows NT/ 2000: The 16-bit Windows system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is SYSTEM. 
     
    5. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.  
    6. The directories that are listed in the PATH environment variable.  有些系统的DLL会强制从系统目录下加载(安全缘故)
      

  3.   

    谁跟你说当前目录优先加载的?
    最优先是从内存映射过来,然后再是WINDOWS目录...,最后才是当前目录
      

  4.   

    LoadLibrary
    一般的都是当前目录优先,
    但是对于kernel32.dll等,强制从系统目录加载了
      

  5.   

    kernel32.dll在KnownDLLs列表里 但是msvcrt.dll并不在看来难以得到确切解答了,总之先结贴吧。