lua-users home
lua-l archive

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


Sergio Fadda <superatropo@gmail.com> wrote:
> Hi.
> I'm writing a standalone application (Win32... windowed) which integrates
> the LUA interpreter; the application uses LUA to export some features and I
> want to show console output in a separated window.

I once wrote a plugin for the JPSoft command processor where I ran into
this problem. See the following threads:

http://lua-users.org/lists/lua-l/2008-07/msg00345.html
http://lua-users.org/lists/lua-l/2008-06/msg00153.html
http://lua-users.org/lists/lua-l/2008-07/msg00188.html

I learned that redirecting I/O in a clean and foolproof manner is
non-trivial. The solution I found for the plugin seems to work but it's
at best a kludge.

So if you want to show output in a *real* console window only (and not
redirect to a file), your best bet is probably to write a small wrapper
for the Win32 console IO functions and to redirect the print/error etc
functions such that they use this wrapper.

-- 
cheers  thomasl

web: http://thomaslauer.com/start