[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: lua_error advice on windows
- From: "Wesley Smith" <wesley.hoke@...>
- Date: Thu, 4 Sep 2008 08:30:09 -0700
I would certainly appreciate seeing the code.
On Thu, Sep 4, 2008 at 4:55 AM, Dave Nichols <email@example.com> wrote:
> I've done this successfully in a Windows context without changing anything
> in the standard Lua core, just overriding various standard Lua functions to
> redirect stdout/err/in to my code. The bulk of it is in Lua with just 2 'C'
> functions to get and put characters from a Window. I can give you the Lua
> code if you want.
> Wesley Smith wrote:
>> Hi list,
>> In our application, we have a console window that is supposed to
>> display stdout and stderr. Essentially, information generated from
>> print(), error() and luaL_error is meant to go to this window. It's
>> pretty straightforward to make this happen on OSX and Linux because
>> you can redirecet the output streams, but on Windows it's a bit of a
>> nightmare since a Windows windowed app doesn't have such output
>> streams unless you call AllocConsole(). I'm able to redirect stout et
>> al to this console windows but I don't really want it to go there.
>> Instead, I want it to go to the application's window like I'm able to
>> do on other platforms.
>> Given this info, I'm wondering what the best approach is to making the
>> user's experience as consistent across platforms. I'd really like to
>> not have the MSDOS type console if possible. The only approach I can
>> think of to do this is to replace the standard Lua functions print()
>> and error() with custom functions that print to the appropriate
>> window. I'll also need to modify where luaL_error output goes, but
>> I'm not sure how to do that (preferably without modifying Lua source
>> code). I would be satisfied with these 3 functions going to the app
>> window even though printf etc. would not. Ideally it would, but from
>> all of the windows documentation and tutorials I've read, I don't
>> think it's possible.
>> Any ideas, comments, etc. greatly appreciated. Windows is not my
>> usual platform, so I'm still trying to figure out how to do this while
>> meeting the expectations of people who do.
> Dave Nichols
> Match-IT Limited
> Tel: 0845 1300 510
> Fax: 0845 1300 610
> Email Disclaimer: The contents of this electronic mail message and any
> attachments (collectively "this message") are confidential, possibly
> privileged and intended only for its addressee ("the addressee"). If
> received in error, please delete immediately without disclosing its contents
> to anyone. Neither the sender nor its management or employees will in any
> way be responsible for any advice, opinion, conclusion or other information
> contained in this message or arising from it's disclosure.