Click here to Skip to main content
15,895,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSimple Full Screen application Pin
ahmetaa1-Nov-03 17:46
ahmetaa1-Nov-03 17:46 
GeneralRe: Simple Full Screen application Pin
Antti Keskinen2-Nov-03 0:03
Antti Keskinen2-Nov-03 0:03 
QuestionCopyFileEx notification?? Pin
Paul Farry1-Nov-03 14:50
professionalPaul Farry1-Nov-03 14:50 
AnswerRe: CopyFileEx notification?? Pin
Blake Coverett1-Nov-03 15:36
Blake Coverett1-Nov-03 15:36 
QuestionC++ imagemap/clickable image? Pin
John Tipper1-Nov-03 12:55
John Tipper1-Nov-03 12:55 
AnswerRe: C++ imagemap/clickable image? Pin
Andrew Walker1-Nov-03 15:02
Andrew Walker1-Nov-03 15:02 
GeneralCTreeCtrl problem Pin
_Sin1-Nov-03 11:11
_Sin1-Nov-03 11:11 
GeneralRun-time objects and CRuntimeClass Pin
Antti Keskinen1-Nov-03 10:08
Antti Keskinen1-Nov-03 10:08 
Hi there !

I made a few searches through the articles and through the board, but didn't manage to find an answer.. If there is already an answer to this, just post the link Smile | :)

So, I have a CCtrlView-derived class, CTabView (No, not a co-incidence). This class is responsible for upkeeping a Tab control (Created through CCtrlView's constructor) and an array of CViews. Now, when you wish to add a new view to the tab, it requires you to insert a pointer to your CView-derived class through the RUNTIME_CLASS-macro. After that, it checks if the run-time info you specified is indeed a CView-derived, and creates a new object based on this info with CRuntimeClass::CreateObject.

When the creation is done, it creates and attaches a new view to this object by casting a pointer to the CView-class and calling it's Create-method. Then, it saves the CView-pointer to a CObList for further use.

When quitting, the application goes through the list and calls each CView's DestroyWindow in succession until the list is clear. After that, it posts a OnDestroy-message to the underlying CCtrlView which destroys the tab control.

But the problem is that when I build & run this app, it works smoothly until the quit phase. There, it causes an assertion. What am I missing here ? Should I use 'delete' on each of the pointers after DestroyWindow as well ? Can it be done ? What, exactly, does CreateObject do when it builds an object from the run-time info ? And if 'delete' is not the answer, what is ?

Or shouldn't I delete the views at all, but let "The Framework" work it out ?

Of course, if someone already has a functioning Tab control which accomplishes the above mentioned smoothly, a link is again appreciated Smile | :)

Thanks in advance,
Antti Keskinen

EDIT: The 'delete' operation did no good, the app still asserts. For additional info, I am using a splitter window to where my derived control view is loaded to. Debugging reveals it is XTreme toolkit's CXTPFrameWnd, which causes the assertion.

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralSimple MFC Timer dos not work! Pin
ahmetaa1-Nov-03 8:34
ahmetaa1-Nov-03 8:34 
GeneralRe: Simple MFC Timer dos not work! Pin
Antti Keskinen1-Nov-03 10:55
Antti Keskinen1-Nov-03 10:55 
GeneralRe: Simple MFC Timer dos not work! Pin
ahmetaa1-Nov-03 12:12
ahmetaa1-Nov-03 12:12 
QuestionHow to access a Global variable from another Dialog box. Pin
Deepak Samuel1-Nov-03 7:05
Deepak Samuel1-Nov-03 7:05 
AnswerRe: How to access a Global variable from another Dialog box. Pin
valikac1-Nov-03 7:07
valikac1-Nov-03 7:07 
AnswerRe: How to access a Global variable from another Dialog box. Pin
Terry O'Nolley1-Nov-03 9:51
Terry O'Nolley1-Nov-03 9:51 
GeneralRe: How to access a Global variable from another Dialog box. Pin
Markyg2-Nov-03 15:21
Markyg2-Nov-03 15:21 
GeneralOutlook Automation (C++) Pin
Anonymous1-Nov-03 6:43
Anonymous1-Nov-03 6:43 
GeneralProperly subclassing list box Pin
georgiek501-Nov-03 3:49
georgiek501-Nov-03 3:49 
GeneralRe: Properly subclassing list box Pin
Michael Dunn1-Nov-03 5:45
sitebuilderMichael Dunn1-Nov-03 5:45 
GeneralDisplaying Keyboard hook processes Pin
imranhabib1-Nov-03 3:40
imranhabib1-Nov-03 3:40 
GeneralRe: Displaying Keyboard hook processes Pin
Duncan Edwards Jones1-Nov-03 4:05
professionalDuncan Edwards Jones1-Nov-03 4:05 
GeneralRe: Displaying Keyboard hook processes Pin
imranhabib1-Nov-03 10:15
imranhabib1-Nov-03 10:15 
Generalfrom where can i get shlobj.h for version 5.0 of shell32.dll Pin
User 2155971-Nov-03 3:17
User 2155971-Nov-03 3:17 
GeneralRe: from where can i get shlobj.h for version 5.0 of shell32.dll Pin
Michael Dunn1-Nov-03 5:47
sitebuilderMichael Dunn1-Nov-03 5:47 
GeneralRe: from where can i get shlobj.h for version 5.0 of shell32.dll Pin
User 2155971-Nov-03 19:03
User 2155971-Nov-03 19:03 
GeneralRe: from where can i get shlobj.h for version 5.0 of shell32.dll Pin
Ravi Bhavnani2-Nov-03 8:39
professionalRavi Bhavnani2-Nov-03 8:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.