#include <Windows.h>
#include <ILuaInterface.h>
#define ver "LUASHARED003"
typedef void* (*CreateInterfaceFn)(const char *pName, int *pReturnCode);
typedef int(*load)(lua_State *, const char *);
typedef int(*pcall)(lua_State *, int, int, int);
BOOL WINAPI DllMain(
HINSTANCE h,
DWORD fdwReason,
LPVOID lp)
{
if (fdwReason == DLL_PROCESS_ATTACH) {
HMODULE luash = GetModuleHandle(L"lua_shared.dll");
CreateInterfaceFn sh_factory = (CreateInterfaceFn) GetProcAddress(luash, "CreateInterface");
load Lua_Load = (load) GetProcAddress(luash, "luaL_loadstring");
pcall Lua_Call = (pcall) GetProcAddress(luash, "lua_pcall");
}
return TRUE;
}