00001 /* 00002 Free Download Manager Copyright (c) 2003-2007 FreeDownloadManager.ORG 00003 Open Download Manager Copyright (c) 2008-2010 OpenDownloadManager.ORG 00004 */ 00005 00006 #include "stdafx.h" 00007 #include "FdmApp.h" 00008 #include "vmsDLL.h" 00009 00010 #ifdef _DEBUG 00011 #undef THIS_FILE 00012 static char THIS_FILE[]=__FILE__; 00013 #define new DEBUG_NEW 00014 #endif 00015 00016 vmsDLL::vmsDLL(LPCSTR pszDll) 00017 { 00018 m_hDLL = NULL; 00019 if (pszDll) 00020 Load (pszDll); 00021 } 00022 00023 vmsDLL::~vmsDLL() 00024 { 00025 00026 } 00027 00028 bool vmsDLL::Load(LPCSTR pszDll) 00029 { 00030 Free (); 00031 m_hDLL = LoadLibrary (pszDll); 00032 if (m_hDLL == NULL) 00033 return false; 00034 return true; 00035 } 00036 00037 void vmsDLL::Free() 00038 { 00039 if (m_hDLL) 00040 { 00041 FreeLibrary (m_hDLL); 00042 m_hDLL = NULL; 00043 } 00044 } 00045 00046 FARPROC vmsDLL::GetProcAddress(LPCSTR pszProcName) 00047 { 00048 if (m_hDLL == NULL) 00049 return NULL; 00050 00051 return ::GetProcAddress (m_hDLL, pszProcName); 00052 } 00053 00054 bool vmsDLL::is_Loaded() 00055 { 00056 return m_hDLL != NULL; 00057 }
1.5.6