|
One of my programs is based on single document type SDI
Dynamically manage and call two videos in the main frame through a document template
CScrollView and CRichEditView
Views currently loaded are automatically destructed when switching views
I used a dynamically created CEdit * m_pEdit object in CScrollView
When used in view m_pEdit = new CEdit; m_pEdit-> Create (..)
Delete m_pEdit when not in use or CScrollView destruct; m_pEdit = NULL;
Do not switch views only in CScrollView constantly new and delete will not go wrong.
problem:
When switching from CScrollView to CRichEditView first,
By tracking, m_pEditCScrollView has been deleted
When switching back to CScrollView, use m_pEdit-> Create (..) in the program code
When I reported an error, I traced this error and found that the Create function of the CEdit class of MFC has an exception.
Click [Ignore] in the exception dialog box and find that this error does not affect the normal operation of the program
The m_pEidt control can also be used normally.
What is the reason, my brother is polite.
How to avoid this exception (you can eliminate the exception prompt box) |
|