Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!uunet!ns-mx!ccad.uiowa.edu!cadsi From: cadsi@ccad.uiowa.edu (CADSI) Newsgroups: comp.lang.c++ Subject: Re: an object killing itself. Message-ID: <1991Jun9.183803.23732@ccad.uiowa.edu> Date: 9 Jun 91 18:38:03 GMT References: <1991Jun9.080138.2540@noose.ecn.purdue.edu> Organization: CAD-Research, U. of Iowa, Iowa City, Iowa Lines: 25 From article <1991Jun9.080138.2540@noose.ecn.purdue.edu>, by helz@gorilla.ecn.purdue.edu (Randall A Helzerman): > Hey net.c++.wisepersons... > I have an application where it would be very convenient for a member > function to be able to do the equivelent of deleting the object it is > a member of, as shown in the following code: > [ stuff deleted ] I use the WM_DESTROY messate in Windows code to do JUST this. It has worked for me (Borland C++) with no hitches. class classofstuff { member1 { do_some_stuff() ; delete this } . . } [source and other stuff deleted] |----------------------------------------------------------------------------| |Tom Hite | The views expressed by me | |Manager, Product development | are mine, not necessarily | |CADSI (Computer Aided Design Software Inc. | the views of CADSI. | |----------------------------------------------------------------------------|