Last active
December 10, 2015 12:08
-
-
Save laheadle/4431714 to your computer and use it in GitHub Desktop.
Winmain Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance, | |
LPSTR lpCmdLine,int nCmdShow) | |
{ | |
lua_State* L = luaL_newstate(); | |
luaL_openlibs(L); | |
luaL_dostring(L, "require \"ezshare\""); | |
lua_getfield(L, LUA_GLOBALSINDEX, "run"); | |
lua_pushlightuserdata (L, hInstance); | |
lua_pushlstring(L, lpCmdLine, strlen(lpCmdLine)); | |
lua_pushinteger(L, nCmdShow); | |
lua_call(L, 3, 1); | |
return lua_tointeger(L, -1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment