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.

Rob


_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail&xAPID=42&PS=47575&PI=7324&DI=7474&SU= http://www.hotmail.msn.com/cgi-bin/getmsg&HL=1216hotmailtaglines_addphotos_3mf