在dll中如何取得自己的路径?

解决方案 »

  1.   

    曾经做过,忘了具体的函数名了
    好象是 GetModuleFilename(),另外还有个mfc函数也实现同样的功能
    楼主自己查下msdn
      

  2.   

    GetModuleFilename好象是取得调用该dll的程序的路径。我需要的是取得dll自己的路径。
      

  3.   

    DWORD GetCurrentDirectory(
      DWORD nBufferLength,
      LPTSTR lpBuffer
    );
      

  4.   

    GetCurrentDirectory是肯定不行的;
    GetModuleFilename,然后Trim掉文件名,
    这是约定俗成的用法