⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stdlib.cpp

📁 LUA 书籍 LUA多数用于游戏中的脚本开发 很受欢迎
💻 CPP
字号:
// stdlib.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include "stdlib.h"

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved
					 )
{
    switch (ul_reason_for_call)
	{
		case DLL_PROCESS_ATTACH:
			break;
		case DLL_PROCESS_DETACH:
			break;
		case DLL_THREAD_ATTACH:
		case DLL_THREAD_DETACH:
			break;
    }
    return TRUE;
}

static int lua_trace(lua_State *L)
{
	Trace(luaL_check_string(L, 1));
	return 0;
}

// IDE calls this function when loading dll
// register lua data here
STDLIB_API int LuaRegister(lua_State* L, HWND hWnd)
{
	// init api library
	InitLibAPI(hWnd);

	// attach DOS console to process (stdin, stdout, stderr)
	AttachConsole();

	// open standard lua libraries
	lua_baselibopen(L);
	lua_tablibopen(L);
	lua_iolibopen(L);
	lua_strlibopen(L);
	lua_mathlibopen(L);

	// Trace outputs messages to IDE debug window
	lua_register(L, "Trace", lua_trace);

	return 0;
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -