lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

C++ Function

void CScriptWindow::WriteByte(DWORD address, BYTE value)
WriteProcessMemory(processhandle, (void *)address, (void *)&value, 1, NULL);

Glue function

int l_WriteByte(lua_State* luaVM)
	DWORD address = 0;
	BYTE value = 0;

	address = (DWORD)lua_tonumber(luaVM, 1);
	value = (BYTE)lua_tonumber(luaVM, 2);

	theScriptWindow->WriteByte(address, value);
	return 1;

When I include this function in my script, it dies. My other C++ functions work fine.


Add photos to your messages with MSN 8. Get 2 months FREE*.