1 #pragma once 2 3 //使用动态方式加载Dll 4 class CDllLib 5 { 6 public: 7 CDllLib(); 8 ~CDllLib(); 9 void Init(const wstring& dll_path); //载入DLL文件并获取函数入口 10 void UnInit(); 11 bool IsSucceed(); //判断DLL中的函数是否获取成功 12 13 protected: 14 virtual bool GetFunction() = 0; //从DLL中获取函数入口地址并保存起来,成功则返回true 15 16 protected: 17 HMODULE m_dll_module; 18 bool m_success{ false }; 19 20 }; 21 22