RE: wxEuphoria
- Posted by Matthew Lewis <matthewwalkerlewis at YAHOO.COM> Mar 10, 2003
- 578 views
> From: David Cuny [mailto:dcuny at LANSET.COM] > Matt Lewis wrote: > > > I've put my latest work on wxEuphoria up on my web page: > > Great! Any chance I might be able to get the source? I've > been wanting to make > a wxWindows DLL for my wrappers, but I'm an idiot when it > comes to creating > DLLs - especialy for wxWindows, where the init stuff is > buried in macros. > > I'm not really worried about name mangling, since the > wrappers take care of > that. I just want to know how to set up the DLL. > > Thanks, and congratulations.! Frankly, creating the DLL was the easiest part, you just have to have MSVC. :) They've got a dll workspace file that compiles straight away. I think the only thing I changed was to turn threading off in setup.h. Then I've used Dependency Viewer to work out the mangled vs unmangled names. I've actually been importing by ordinal, although I'm in the process of changing to straight names, and making that whole process more automated. The Euphoria source is all there on my page. I basically followed what happens in wxEntry, and got rid of all the calls that caused crashes. :) Here is the initialization code from wxEuphoria.e (it's somewhat scattered in the code): global atom myApp_this void = call_cdecl( wxEntryStart, {0,0}) myApp_this = new_instance( wxApp, 0, {}) poke4( wxTheApp, myApp_this ) global procedure wxMain( atom topWindow ) set_event_handler( topWindow, get_id(topWindow), wxEVT_CLOSE_WINDOW, routine_id("OnCloseWindow") ) void = call_thiscall( wxFrame_Show, topWindow, {1}) void = call_member( wxApp_MainLoop, myApp_this, {} ) topWindow = call_member( wxApp_GetTopWindow, myApp_this, {} ) if topWindow then if call_member( wxObject_IsKindOf, topWindow, { sm_classwxFrame }) or call_member( wxObject_IsKindOf, topWindow, { sm_classwxWindow }) then void = call_member( wxWindow_Close, topWindow, {1} ) void = call_member( wxApp_DeletePendingObjects, myApp_this, {} ) else wx_free( topWindow ) void = call_member( wxApp_SetTopWindow, myApp_this, {0}) end if end if end procedure Matt Lewis