Re: something is wrong
- Posted by Matt Lewis <matthewwalkerlewis at yahoo.com> Aug 24, 2004
- 404 views
Juergen Luethje wrote: > > Hi Igor, > > you wrote: > > > I'm playing with the clock.exw program - one of > > the win32lib demos (v0060.03). > > > > It is 1603 bytes at all. It works OK if it is interpreted, > > both in English & in Russian, but doesn't show the current > > time if translated to C and compiled with Open Watcom v1.2 > > compiler, both in English & in Russian, (on Win95). > > > > It gives 77 files of C source code (3,487,386 bytes at all) > > and the compiled clock.exe is huge - 1,368,064 bytes. > > <snip> > > I have Win32Lib 0.60.1 here (on Windows 98), and just tested its > 'clock.exw' program. The results are pretty much the same than yours: > > - Interpreted with 'exw.exe' 2.4 (Complete Edition), it runs as > expected. That is, it shows a window, that only consists of a title > bar, which displays the system time. > > - Translated to C with 'ecw.exe' 2.4, and compiled with the Open Watcom > compiler 1.0, an EXE file with a size of 1384448 bytes is produced. > Running this EXE file shows the same window, but its title bar doesn't > display anything. > > - Translated to C with 'ecw.exe' 2.4, and compiled with the Borland > compiler 5.5, an EXE file with a size of 1376256 bytes is produced. > Running this EXE file shows the same window, but its title bar doesn't > display anything. It also doesn't seem to run correctly when bound. It simply opens up and displays "Clock". I think the problem is that using the forms and the w32Start.ew methodology (with which I am not familiar), you end up with calls to routine_id() using a variable, which means that all routines must be kept, so you basically end up with all of Win32Lib. Converting to the 'old' style of actually creating controls and using setHandler(), bind works fine (exe goes from about 340K to 230K). Translated and compiled with OpenWatcom 1.2, I go from about 1.3M to 940K, plus it works now. When binding, I get the message that AppCallback is renamed, because it conflicts with an earlier symbol. In w32Start.ew, changing it to AppCallback1 fixed the problem when binding. I can't find where it's previously defined, however, so this appears to be a bug in the binder. This doesn't fix the translated version, where changing the name of the procedure doesn't make any difference. So, the bound version can't find the procedure AppCallback, because it gets renamed for some reason, but once it finds that, it runs fine. The translated version doesn't have any problem finding this, but does have problem finding the event handlers' routine ids. It finds them just fine from within clock.exw, but not from within w32Start.ew. It can call the procedures, but can't get their routine_ids. The only thing I can think of is that routine_id has an error testing whether the routine is really in scope (it is). Matt Lewis