查到的相关信息
载入指定的动态链接库,并将它映射到当前进程使用的地址空间。一旦载入,即可访问库内保存的资源 能否据个例子呢,谢谢大家

解决方案 »

  1.   

    A common use of this function is to load a dynamic-link library (DLL), perform a subsequent call to GetProcAddress() to get the address of an exported DLL routine, and call this DLL routine through the address that is returned. Another use of LoadLibrary() is to load an executable module and retrieve its resources. #include <windows.h>
    #include <mshtmhst.h>{
    HINSTANCE   hinstMSHTML = LoadLibrary(TEXT("MSHTML.DLL"));if(hinstMSHTML)
       {
       SHOWHTMLDIALOGFN  *pfnShowHTMLDialog;
          
       pfnShowHTMLDialog = (SHOWHTMLDIALOGFN*)GetProcAddress(hinstMSHTML, TEXT("ShowHTMLDialog"));   if(pfnShowHTMLDialog)
          {
          /*
          Perform initialization and then call ShowHTMLDialog.
          */
          }
       
       FreeLibrary(hinstMSHTML);
       }
    }
      

  2.   

    载入后会得到一个句柄.这个句柄可在getproaddress使用,用于得到某个函数的地址(API型DLL).也可以取得这个DLL中的资源(如果有的话).一般来说在VB里不是很常用这个函数.
      

  3.   

    谢谢,可以看懂一写
    GetProcAddress(查出的句柄,Functionname)
    得到这个又可以干什么呢,谢谢,是不是可以修改dll资源呢?如果可以应该怎样做呢,谢谢啦
      

  4.   

    服了csdn,说我回复太快Private Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
    Private Declare Function GetProcAddress Lib "kernel32" (ByVal hModule As Long, ByVal lpProcName As String) As Long
    Private Sub Form_Load()
    MsgBox Hex(GetProcAddress(LoadLibrary("kernel32.dll"), "GetTickCount"))
    End Sub得到了1个long,剩下的不会了
      

  5.   

    http://ms.mblogger.cn/supergreenbean/posts/5540.aspx
      

  6.   

    在 VB 中不需要用这个。用了反而有可能出问题。因为在 VB 中,你是通过 Declare 关键字声明库中函数,在调用时动态打开。这样的模式是最合理的,节省资源。实际上,在 VC++ 中,它也是可以不用的。正确引用和声明后,编译后的代码在执行时能够在操作系统中实现动态调用。