Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!wuarchive!emory!stiatl!tdp From: tdp@stiatl.UUCP (Tim Porter) Newsgroups: comp.windows.ms Subject: Re: WinApp Development Under Win3 Keywords: WinApp, Development, Win3 Message-ID: <324@stiatl.UUCP> Date: 24 Jan 91 00:10:26 GMT References: <953@venice.SEDD.TRW.COM> <1991Jan15.192544.24643@sunee.waterloo.edu> Organization: Sales Technologies Inc. Atlanta, Ga. Lines: 38 In article <953@venice.SEDD.TRW.COM> press@venice.sedd.trw.com (Barry Press) writes: >Iv'e been trying to move my windows application development from DOS, with >win3 sessions for testing, to a completely win3 (enhanced mode), but something >must be escaping me, because there are some problems ... > >When you execute an application and then close it, windows has not >necessarily "forgotten" about the instance. This manifests itself in that >the passed hPrevInstance may be non-zero even if that instance was closed. >Because of this, if you recompile an application and try to run it, it won't >run. > >Has any one else seen this? I've tried compressing the heap with heapwalk, >and it didn't "forget". Thanks. >-- >Barry Press Internet: press@venice.sedd.trw.com I have just begun to learn how to program in Windows, so I can't promise you that my 2 cents will be worth even that much. But I have run into this problem before, so I'll tell you the 2 things that I was doing wrong that you might check for... 1) Make sure you are catching the WM_DESTROY message in your main window procedure and are calling PostQuitMessage() to terminate the main message loop. Catching the WM_CLOSE message and doing a DestroyWindow() is not good enough. It will NOT terminate the main message loop, which means that even though the window has be nuked, to Windows that instance of the executable is still running. 2) Make sure you don't have an iconized version of the program running. (dumb I know, but I did do this) Hope this helps. -- /***************************************************************************\ | Tim Porter emory!stiatl!tdp | | Sales Technologies, Inc Atlanta, GA (404) 841-4000 | \***************************************************************************/