xref: /MusicPlayer2/MusicPlayer2/DllLib.cpp (revision 877f5f92b251a01591a4960c885129aa589a8135)
1 #include "stdafx.h"
2 #include "DllLib.h"
3 
4 
CDllLib()5 CDllLib::CDllLib()
6 {
7 }
8 
9 
~CDllLib()10 CDllLib::~CDllLib()
11 {
12 }
13 
Init(const wstring & dll_path)14 void CDllLib::Init(const wstring & dll_path)
15 {
16     //载入DLL
17     m_dll_module = ::LoadLibrary(dll_path.c_str());
18     //获取函数入口
19     bool rtn = false;
20     if(m_dll_module != NULL)
21         rtn = GetFunction();
22     //判断是否成功
23     m_success = (m_dll_module != NULL && rtn);
24 }
25 
UnInit()26 void CDllLib::UnInit()
27 {
28     if (m_dll_module != NULL)
29     {
30         FreeLibrary(m_dll_module);
31         m_dll_module = NULL;
32     }
33 }
34 
IsSucceed()35 bool CDllLib::IsSucceed()
36 {
37     return m_success;
38 }
39