Re: Routine_ID Is No Doubt My Solution...
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Apr 16, 2003
- 444 views
On Tue, 15 Apr 2003 01:19:00 -0700, David Cuny <dcuny at LANSET.COM> wrote: >But perhaps my most nastiest encounter with routine_id had to do with = bind and=20 >shroud. I'm getting into ancient history here, and most of this has = already=20 >been solved I wish. C. K. Lester's post spurred me on to try shrouding my program. The problem I faced is that as a library routine it uses win32lib.ew and database.e; however I _really_ did not want them packed with the routine; instead I want to use the ones included by the calling application (so there is only one event loop, only one WinMain, etc). Anyway, it has been a long hard four day slog, but I eventually got it working (today) with: <shrouded part:> 80 of these: integer zAddItem global procedure AddItem(integer id, object item) -- add item(s) to List/Combo id call_proc(zAddItem,{id,item}) end procedure and 17 of these: global integer window,.... global procedure initialise_pprg(integer rid, integer vid)=20 -- note this is called by the unshrouded part..... zAddItem=3Dcall_func(rid,{"addItem"}) .... s=3Dcall_func(vid,{}) window =3Ds[1] .... and 251 stolen copies of various constants, eg global constant=20 WS_POPUP =3D #80000000, -- fingers firmly crossed on that set! (I do expect to get slapped each time a new version of win32lib is released, but making that safer is a problem for another day) <unshrouded part:> [You gotta love this one!] global function routineid(sequence name) return routine_id(name) end function global function vset() return {Window,.... end function initialise_pprg(routine_id("routineid"), routine_id("vset")) The unshrouded part is needed so that routine_id can "see" the copy of win32lib loaded by the application and set up the bank of 80 routine_ids and 17 control types for the shrouded part. Oh, and I forgot about editing the three and a half thousand lines of code of my routine replacing eg "addItem" with "AddItem", "Window" with "window", etc. Not a very happy bunny, Pete