如题。
#import "msado15.dll",之后不管你装在C盘或者装在D盘,都可以正常运行
那么程序是怎么知道DLL的全路径的?是怎么去查找的

解决方案 »

  1.   

    import中查找msado15.dll过程是
    系统路径,环境变量路径,应用程序路径,应用程序工作路径.
      

  2.   

    你把msado15.dll改到其他地方,就不可以了,系统先找环境变量 应用程序路径的,如果你在程序中指定了路径当然直接用你的路径了
      

  3.   

    这个是在系统路径里的啊.
    正常是这个DLL已经在系统里有注册,所以你在高用该DLL提供的接口函数的时候系统就根据CLSID找到DLL所在的完整路径了.
    这里#import "msado15.dll"的时候只是在你开发的时候有用,而完成编译生成可执行程序以后这个就没有任何用了.因为在编译的时候将需要的所以在东西都已经编入你的程序里了.
      

  4.   

    path环境变量里头有搜索路径设置
      

  5.   

    Quoted form 
        This form instructs the preprocessor to first look for type library files in the same directory of the file that contains the #import statement, and then in the directories of whatever files that include (#include) that file. The preprocessor then searches along the paths shown below. Angle-bracket form 
       This form instructs the preprocessor to search for type library files along the paths shown below. 
    The compiler will search in the following directories for the named file: the PATH environment variable path list
    the LIB environment variable path list
    the path specified by the /I (additional include directories) compiler option
      

  6.   

    环境变量
    dll路径
    当前路径
    system32
    system
    windows