仕方ないからTaoを使うようにした
そしたらどうもCallがうまいこといかない
'存在している場合
Dim L As New System.IntPtr
L = Tao.Lua.Lua.luaL_newstate()
Tao.Lua.Lua.lua_open()
'LUA読み取り
Tao.Lua.Lua.luaL_openlibs(L)
If Tao.Lua.Lua.luaL_loadfile(L, full) Then
Dim str = Tao.Lua.Lua.lua_tostring(L, 1)
MessageBox.Show(str, "err")
End If
Dim top = Tao.Lua.Lua.lua_gettop(L)
'関数名Push
Tao.Lua.Lua.lua_getglobal(L, "GraphicSetting")
'関数呼び出し(ここでNULLがかえる)
If Tao.Lua.Lua.lua_pcall(L, 0, 7, 0) Then
Dim str = Tao.Lua.Lua.lua_tostring(L, 1)
MessageBox.Show(str, "err2")
End If
'関数の戻り値を格納
Dim a = Tao.Lua.Lua.lua_tostring(L, 1)
Dim b = Tao.Lua.Lua.lua_tointeger(L, 2)
Dim c = Tao.Lua.Lua.lua_tointeger(L, 3)
Dim d = Tao.Lua.Lua.lua_tointeger(L, 4)
Dim f = Tao.Lua.Lua.lua_tointeger(L, 5)
Dim g = Tao.Lua.Lua.lua_tointeger(L, 6)
Dim h = Tao.Lua.Lua.lua_tointeger(L, 7)
'HelpTextBox.Text = Tao.Lua.Lua.lua_tostring(L, 0)
'TypeComBox.SelectedIndex = Tao.Lua.Lua.lua_tointeger(L, 1)
'AllNumNmBox.Value = Tao.Lua.Lua.lua_tointeger(L, 2)
'XNumNmBox.Value = Tao.Lua.Lua.lua_tointeger(L, 3)
'YNumNmBox.Value = Tao.Lua.Lua.lua_tointeger(L, 4)
'XSizeNmBox.Value = Tao.Lua.Lua.lua_tointeger(L, 5)
'YSizeNmBox.Value = Tao.Lua.Lua.lua_tointeger(L, 6)
Tao.Lua.Lua.lua_settop(L, top)
0 件のコメント:
コメントを投稿