FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
dllmain.cpp
1 // dllmain.cpp : Implementation of DllMain.
2 
3 #include <boost/scoped_array.hpp>
4 #include "win_common.h"
5 #include "axmain.h"
6 #include "axutil.h"
7 #include "precompiled_headers.h" // On windows, everything above this line in PCH
8 
9 HINSTANCE gInstance(NULL);
10 std::string g_dllPath;
11 
12 // DLL Entry Point
13 extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
14 {
15  if (!gInstance) {
16  gInstance = hInstance;
17  boost::scoped_array<TCHAR> strDLLPath1(new TCHAR[_MAX_PATH]);
18  ::GetModuleFileName(gInstance, strDLLPath1.get(), _MAX_PATH);
19 
20  g_dllPath = FB::wstring_to_utf8(strDLLPath1.get());
21  }
22  return _AtlModule.DllMain(dwReason, lpReserved);
23 }
24 
std::string wstring_to_utf8(const std::wstring &src)
Accepts a std::wstring and returns a UTF8-encoded std::string.
Definition: utf8_tools.cpp:37