🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #1857

Borland OWL --- cleaning up windows

#1857
From: Bert J. Dempsey
Date: Thu, 24 Dec 1992 16:42
51 lines
1713 bytes
 Here's my OWL-based programming problem----any comments appreciated.

   I want to have the following (pseudo) code where GP and GP2
   are global pointers of the proper types--

in file1.cpp I have:

   TWindowClass1::TWindowClass1(...)
	{
          ...
	  GP2 = new TWindowClass2(this, "ATitle");
	  ...
	}


in file2.cpp (my application) I have:
	
	...
	GP = new TWindowClass1(this, "AnotherTitle");
	...

	Now, my simple question-------->

	how do I correctly clean up (say later in file2.cpp) ?

	Possibilities seem to include:

		(1)  GP->ShutDownWindow();

		or (2)  DestroyWindow(GP);

		or (3) GP->ShutDownWindow(); delete GP;

		or maybe (4) GP->ShutDownWindow(); delete GP2; delete GP;


	Can someone clear up my confusion on the relationship between 
	destroying the window and releasing the memory of the 
	associated interface object? Thanks.


-- 
Bert Dempsey   (bjd7p@uvacs.cs.Virginia.EDU)
Computer Science, University of Virginia

"Language is not an abstract construction of the learned...but is 
something arising out of the work, needs, ties, joys, affections,
tastes, of long generations of humanity, and has its bases broad 
and low, close to the ground."   --Walt
		
Technical Details
Message-ID: <1992Dec24.164230.28240@murdoch.acc.Virginia.EDU>
Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!darwin.sura.net!uvaarpa!murdoch!uvacs.cs.Virginia.EDU!bjd7p

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!darwin.sura.net!uvaarpa!murdoch!uvacs.cs.Virginia.EDU!bjd7p
From: bjd7p@uvacs.cs.Virginia.EDU (Bert J. Dempsey)
Subject: Borland OWL --- cleaning up windows
Message-ID: <1992Dec24.164230.28240@murdoch.acc.Virginia.EDU>
Sender: usenet@murdoch.acc.Virginia.EDU
Organization: University of Virginia Computer Science Department
Date: Thu, 24 Dec 1992 16:42:30 GMT
Lines: 51