home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / mswindo / programm / misc / 4474 < prev    next >
Encoding:
Text File  |  1992-12-24  |  1.6 KB  |  62 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!uvaarpa!murdoch!uvacs.cs.Virginia.EDU!bjd7p
  3. From: bjd7p@uvacs.cs.Virginia.EDU (Bert J. Dempsey)
  4. Subject: Borland OWL --- cleaning up windows
  5. Message-ID: <1992Dec24.164230.28240@murdoch.acc.Virginia.EDU>
  6. Sender: usenet@murdoch.acc.Virginia.EDU
  7. Organization: University of Virginia Computer Science Department
  8. Date: Thu, 24 Dec 1992 16:42:30 GMT
  9. Lines: 51
  10.  
  11.  
  12.  Here's my OWL-based programming problem----any comments appreciated.
  13.  
  14.    I want to have the following (pseudo) code where GP and GP2
  15.    are global pointers of the proper types--
  16.  
  17. in file1.cpp I have:
  18.  
  19.    TWindowClass1::TWindowClass1(...)
  20.     {
  21.           ...
  22.       GP2 = new TWindowClass2(this, "ATitle");
  23.       ...
  24.     }
  25.  
  26.  
  27. in file2.cpp (my application) I have:
  28.     
  29.     ...
  30.     GP = new TWindowClass1(this, "AnotherTitle");
  31.     ...
  32.  
  33.     Now, my simple question-------->
  34.  
  35.     how do I correctly clean up (say later in file2.cpp) ?
  36.  
  37.     Possibilities seem to include:
  38.  
  39.         (1)  GP->ShutDownWindow();
  40.  
  41.         or (2)  DestroyWindow(GP);
  42.  
  43.         or (3) GP->ShutDownWindow(); delete GP;
  44.  
  45.         or maybe (4) GP->ShutDownWindow(); delete GP2; delete GP;
  46.  
  47.  
  48.     Can someone clear up my confusion on the relationship between 
  49.     destroying the window and releasing the memory of the 
  50.     associated interface object? Thanks.
  51.  
  52.  
  53. -- 
  54. Bert Dempsey   (bjd7p@uvacs.cs.Virginia.EDU)
  55. Computer Science, University of Virginia
  56.  
  57. "Language is not an abstract construction of the learned...but is 
  58. something arising out of the work, needs, ties, joys, affections,
  59. tastes, of long generations of humanity, and has its bases broad 
  60. and low, close to the ground."   --Walt
  61.         
  62.