What's new

Parent & child windows

Doomulation

?????????????????????????
I was wondering if you had any information that could help me...
I'm developing an app that needs to work with two windows. The main window and another. Basically, I want the second to stay on top of the first one, sorta like a child window. I have been unable to do this, however...

The reason as to why, is that as the user selects from a list in the main window, the information it represented and displayed in the second window.

The second window is (this is MFC) a class in the main class:

Code:
class CFirstWin { ... CSecondWin dlg; ... }

Later, I tried to set the parent to the main window using SetParent. When I do, either one of two things happen: the whole program stalls, like a dead lock. Or two, it works, but GetParent returns NULL (hence causing an assertion when trying to center or display the window).

I tried to put it on top... but since it will ALWAYS be on top, even when switching to other applications, it won't work. I was unable to find proper messages to focus, so I haven't tried to continue that idea...

I tried creating the dialog on the heap before, in which it actually worked as it should! BUT... when I try to delete it, I get an assertion telling me that it's an incorrect memory block type... it isn't of the normal block, for some reason, and that is why it asserts... but otherwise it deletes it fine. I aquired the heap header for it and it looks alright. No bad writing has been done from what I could see... so... why would this happen? I have no idea.

Any information that can help me is appreciated.
 
OP
Doomulation

Doomulation

?????????????????????????
Okay, thanks for no help, I guess. I figured it all out... seems objects call a different delete function to destroy objects, which I didn't take into account.
 

Top