用depends打开后可以知道DLL里面的Function名,入口地址(entry point)等,但是在程序中怎么才能用呢?比如我下载了一个PSAPI.LL,在程序里面怎么才能用他的函数?怎么才能include“PSAPI。H”?谢谢

解决方案 »

  1.   

    动态库可以动态载入(LoadLibrary),然后可以导出函数来,不过你必须知道函数名称和参数类型,否则不行。
      

  2.   

    首先要得到DLL中的函数定义,写成一个.h文件include到工程中才可以。
    一般这个头文件是由DLL的发行者提供的,如果没有就很麻烦了,因为depends只能看到函数名但没有函数参数,只能自己慢慢分析
      

  3.   

    下载平台SDK
    http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
      

  4.   

    这是MSDN里面的:先定义一个头文件   
    EnumProc.h
       *********************/
       #include <windows.h>   typedef BOOL (CALLBACK *PROCENUMPROC)( DWORD, WORD, LPSTR,
          LPARAM ) ;   BOOL WINAPI EnumProcs( PROCENUMPROC lpProc, LPARAM lParam ) ;
    在用这个......
     hInstLib = LoadLibraryA( "PSAPI.DLL" )怎么还有这样的错误:
    :\program files\microsoft visual studio\vc98\include\tlhelp32.h(26) : error C2146: syntax error : missing ';' before identifier 'WINAPI'
    c:\program files\microsoft visual studio\vc98\include\tlhelp32.h(26) : error C2501: 'HANDLE' : missing storage-class or type specifiers
    c:\program files\microsoft visual studio\vc98\include\tlhelp32.h(26) : fatal error C1004: unexpected end of file found
    郁闷啊~!!!
      

  5.   

    哈哈,原来是少了个";"号
    hInstLib = LoadLibraryA( "PSAPI.DLL" );