RE: wxWindows DLLs
- Posted by Matthew Lewis <matthewwalkerlewis at YAHOO.COM> Feb 04, 2003
- 489 views
> From: David Cuny [mailto:dcuny at LANSET.COM] > A short time back someone posted something about wrapping > wxWindows in a DLL. > I've been looking for an example of how to do this for some time. > > If I could get an example of how this could be done, I'd > appreciate it. I think it was me. I simply compiled wxWindows with MSVC, using the project/workspace files that came with the source. I haven't tried it, but I think that there's a Borland makefile for making a dll. In any case, I use Dependency Walker to get a listing of all the exports--undecorated--and I've been importing them by ordinal, and calling by pointer. I haven't touched this stuff for a couple of weeks, but here's about where I am. I've been able to create a window, but unable to get the main message loop to work. I've been getting error messages from event.c (line 699, IIRC), but haven't figured out where they're really coming from, since I've been doing a lot of the work on a box w/out MSVC, so I've been without a debugger. I've probably declared something wrong somewhere, and its a really stupid bug, but it's going to be a real pain to figure out. The debug version of the dll is about 4.8Mb (takes about a half hour to compile on a P/MMX 200), though it UPXs down to about 1.5Mb, and then zips to a little over 1Mb. There are between 11,000 and 12,000 exports. Here's what I've done in Eu to try to make it work: Set up an OnInit for class MyApp. Set up a wxCreateApp function that allocates memory and calls the wxApp constructor, then pokes the address for MyApp::OnInit into the vtbl. Call wxAppInitializer (it's exported in the dll) with a pointer to wxCreateApp. Then I call wxEntry. I've been trying to translate the Fractal demo that comes with the source, so MyApp::OnInit calls code that creates a Frame. And then it breaks... Matt Lewis