![]() |
|
#1
|
|||
|
|||
Click X in window won't destroy itself ?I am making a dialog based application and I am trying to jump around from window to window using the following Idea:
create a new window. (modeless) endcurrent window with this->EndDialog(0); I am not really sure whats happening, but it seems somewhere windows are not being killed propertly. or something is using a lot more memory then it should. Basically I think it could be 2 things. #1 Does EndDialog free any memory that it uses, or just hide the window ? #2 Does pressing the X to close the window destroy it completely, or do I need to do "delete" on it ? |
|||
|
#2
|
|||
|
|||
Re: Click X in window won't destroy itself ?Don't know if it helps, but with a quick look it says everywhere EndDialog() is used for modal dialogs. Maybe you could try DestroyWindow() ?
|
|
#3
|
|||
|
|||
Re: Click X in window won't destroy itself ?On msdn it says the destroy window doesn't destroy the CWnd object.
I guess my problem is in the main design. If I create a window from a window,then destroy the first window, i've lost the pointer and can't delete the second one. I'm not sure how to get around that, cause its kind of a chain of windows, each one passing information to the next via CWnd derived class constructor. |
|
#4
|
|||
|
|||
Re: Click X in window won't destroy itself ?Isn't the window an object then? If it is, you can get its address with the this pointer. So pass that address to the next window, or create some kind of a window creater function that deletes the former window and creates a new one. Maybe?
|
|
#5
|
|||
|
|||
Re: Click X in window won't destroy itself ?err, yes of course, didn't think of that, so simple
Ill try that, thanks a lot ! |
Recent GIDBlog
Install Adobe Flash - Without Administrator Rights by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Traditional Win32 programming vs. wxWidgets | Zorachus | C++ Forum | 2 | 10-Feb-2007 17:54 |
| how to detect mouse click in child window created by CHTMLEDITVIEW | terr | MS Visual C++ / MFC Forum | 0 | 08-Sep-2006 13:12 |
| need help with a console menu system | BullBuchanan | C++ Forum | 6 | 20-Aug-2006 14:46 |
| Win32 Window Shading behavior (like linux) | WillyumYum | C++ Forum | 3 | 18-Apr-2005 14:36 |
| Changing window start colour | Rosdahale | C++ Forum | 5 | 19-Jan-2005 15:51 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The