1)HMODULE hm = LoadLibrary("c:\test\test.dll"); //假设DLL路径是c:\test\test.dll
2)PFUNC pFunc = (PFUNC)GetProcAddress((HINSTANCE)hm, _T("fun1")); //Find a function and use it
   if (pFunc != NULL)
    {
      int n = pFunc();      //typedef int (*PFUNC)(void);
...
    }
3)FreeLibrary((HMODULE)hm);   //Finally, don't forget to free it.

See Plug-in Architecture Framework for Beginners at http://www.codeguru.com/Cpp/misc/misc/plug-insadd-ins/article.php/c3879

相关文章:

  • 2021-09-17
  • 2021-12-11
  • 2021-10-07
  • 2021-12-09
  • 2021-06-05
  • 2021-08-11
  • 2021-06-28
  • 2021-08-14
猜你喜欢
  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
  • 2021-06-19
  • 2022-12-23
  • 2022-12-23
  • 2021-07-09
相关资源
相似解决方案