ahodgson@athena.mit.edu (Antony Hodgson) (12/20/90)
Our lab is beginning to write a series of programs to control various pieces of equipment. These programs will run under Windows and we're using the Zortech compiler (not the '386 version yet - that came out after we started the project). I've been trying to modify the example code that Zortech sends out so that it's easier to create new applications (i.e., all the Windows interface stuff gets nicely encapsulated so we don't have to deal with it EVERY time!). To that end, I created a new hierarchy with WBase at the bottom, an Instance class which gets created once per invocation of the program, and an Application class which derives from WBase and is responsible for creating the main application window and setting up the Instance object properly. I've implemented a decent virtual call-back mechanism so that any descendent of WBase can respond directly to WM_CREATE, WM_PAINT, and WM_DESTROY messages, and can have a shot at handling any other messages before handing them back to the default procedure. The offer I'm making is that anyone is welcome to have and use the code I wrote (provided you don't charge anyone else for it, of course :) ), but the challenge is that something doesn't seem quite right. I tested the code by writing a Test Application which worked fine as long as I put non-trivial code in place to override the default Paint() function. If I didn't put non-trivial code there, then the program hangs Windows, even though it never calls this Paint() function during its execution. Since a real application would have non-trivial code there, I expect it to run properly, but it bothers me that I can't figure out this strange behaviour. I would be very glad to have anyone with more expertise in Windows than I do take a look at this code. If you're interested, please let me know. Tony Hodgson ahodgson@hstbme.mit.edu