
Untitled
By: a guest on
May 28th, 2012 | syntax:
None | size: 1.12 KB | hits: 17 | expires: Never
#include <Windows.h>
#include <gamearmor/loader.h>
extern "C" void __declspec(dllexport) LoadGA()
{
}
class test1
: public gamearmor_module
{
public:
test1()
: gamearmor_module("Test 1")
{
}
virtual gam_result initialize()
{
return GAM_SUCCESS;
}
};
test1 test1_instance;
template<> test1 *gamearmor_module_manager<test1>::instance() { return &test1_instance; }
class test2
: public gamearmor_module
{
public:
test2()
: gamearmor_module("Test 2")
{
}
virtual gam_result initialize()
{
return GAM_SUCCESS;
}
};
test2 test2_instance;
template<> test2 *gamearmor_module_manager<test2>::instance() { return &test2_instance; }
BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
{
gamearmor_loader ld;
try
{
ld.module<test1>(1000);
ld.module<test2>(2000);
ld.run();
}
catch (std::exception &ex)
{
}
}
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}