lua-users home
lua-l archive

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

Chunlin Zhang <> [2010-10-11 20:51:25]:

> On Mon, Oct 4, 2010 at 3:07 PM, Petr Štetiar <> wrote:
> > Fietiger Cheng <> [2010-10-04 11:25:34]:
> >> I am Cheng Wentao from China. I am interesting with you project luace at
> >> But I have a problem when distribute luace.exe to my cell phone
> >> (WM5 SmartPhone platform); I got no response when run hello.lua. So I have
> >> to create a project and redirect print function to my dialog, and change
> >> io.write to print in lua code.Then test some samples on my cell phone,they
> >> work well. But I still want to know how io.write works ,could I redirect it
> >> to my dialog?
> >
> I try luace several months ago,I remember that when I use luace.exe to
> run lua script,it output stdout in VisualStudio(VS2008) output
> window.I just use a WM6.5 emulator.

Sorry, I still have problems to understand what do you mean and what do you
want :-)

Just copy luace.exe, lua51.dll, yourdll.dll and test.lua script to your
emulator and then run 'luace.exe test.lua' on your device. Something like a
week ago I've tested luace on Dolphin 9700 device with WM6.5 and it was
working without any problem. Well, to be exact I didn't tested luace.exe, but
just the lua51.dll, because I've just run my application which is scriptable
using Lua. But if the lua51.dll works, luace.exe will work also. luace.c is
just the wrapper for WinMain in Windows CE, because there is no main()

Anyway you can quickly change luace.exe in the way, that it will load
init.lua script each time it's executed, there's the diff:

diff --git a/luace.c b/luace.c
index e891735..ba20f00 100644
--- a/luace.c
+++ b/luace.c
@@ -48,7 +48,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE
                len = 1;

-       p = cmd = wceex_wcstombs(wcmdline);
+       p = cmd = wceex_wcstombs(L"init.lua");

        /* parse commandline */
        while (*p) {

I've compiled it for you, along with the example DLL, so just unzip the
archive[1] to the same dir on the device and run just luace.exe. Does it works
for you? If so, it's some PEBKAC probably :-)


-- ynezz