////////////////////////////////////////////////////////////////////////////// /** * @file LoadLibrary.h * @brief 加载DLL或EXE模块,是对::LoadLibrary函数的封装 * @author * @date 2012-4-20 *//////////////////////////////////////////////////////////////////////////// #pragma once class CLoadLibrary { public: CLoadLibrary(void); ~CLoadLibrary(void); /** @brief Get a handle to the DLL module. */ BOOL LoadLibrary(LPCTSTR lpFileName); /** @brief Free the DLL module. */ BOOL FreeLibrary(); BOOL IsLoaded() { return m_hDLL!=NULL ? TRUE:FALSE; } /** @brief Retrieves the address of an exported function or variable from the specified dynamic-link library (DLL). */ FARPROC GetProcAddress(LPCSTR lpProcName); protected: CString m_strFileName; //文件名(*.dll) HINSTANCE m_hDLL; };