-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.cpp
47 lines (39 loc) · 982 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "main.h"
#include <framework/platform/platform.h>
#include <framework/core/consoleapplication.h>
#include <sstream>
extern Platform g_platform;
void DLL_EXPORT Notify(const LPCSTR sometext)
{
MessageBoxA(0, sometext, "DLL Message", MB_OK | MB_ICONINFORMATION);
}
void DLL_EXPORT MessageBox(std::string s)
{
MessageBoxA(0, s.c_str(), "Notice!", MB_OK | MB_ICONINFORMATION);
}
void initialize(){
MessageBox(g_platform.getCPUName());
Notify("Aplication started, lets rock now!");
g_app.run();
}
extern "C" BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
switch(dwReason)
{
case DLL_PROCESS_ATTACH:
{
CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)initialize,NULL,0,NULL);
break;
}
case DLL_PROCESS_DETACH:
{
Notify("Goodbye dll.");
//delete &debugger;
break;
}
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
break;
}
return 1;
}