Click here to Skip to main content
16,007,472 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMust a view be derived from CWnd when... ? Pin
Chen Jiadong11-Nov-02 2:29
Chen Jiadong11-Nov-02 2:29 
AnswerRe: Must a view be derived from CWnd when... ? Pin
jhwurmbach11-Nov-02 2:38
jhwurmbach11-Nov-02 2:38 
GeneralRe: Must a view be derived from CWnd when... ? Pin
Chen Jiadong11-Nov-02 2:54
Chen Jiadong11-Nov-02 2:54 
GeneralRe: Must a view be derived from CWnd when... ? Pin
jhwurmbach11-Nov-02 3:07
jhwurmbach11-Nov-02 3:07 
GeneralRe: Must a view be derived from CWnd when... ? Pin
Chen Jiadong11-Nov-02 3:19
Chen Jiadong11-Nov-02 3:19 
GeneralRe: Must a view be derived from CWnd when... ? Pin
jhwurmbach11-Nov-02 3:38
jhwurmbach11-Nov-02 3:38 
GeneralRe: Must a view be derived from CWnd when... ? Pin
Chen Jiadong11-Nov-02 4:20
Chen Jiadong11-Nov-02 4:20 
GeneralRe: Must a view be derived from CWnd when... ? Pin
jhwurmbach11-Nov-02 4:34
jhwurmbach11-Nov-02 4:34 
Without doc/view you don't need to (you must not) delete, because your CHtmlView is on the stack (you simply made a variable like 'CHtmlView htv;').
As you probably know (I dont know your programming background), delete is for disposing variables made on the heap (as in 'CHtmlView* pHtv = new CHtmlView;'). Calling delete on a variable that is not on the heap (or calling it twice) is not correct.
If you check doc/view in the App wizard, MFC constructs your CView (or derived class like CHtmlView) somehow 'behind your back', using new.
In this case, when the View decides it has to go away, it calls 'delete this;', and frees its own memory.
GeneralRe: Must a view be derived from CWnd when... ? Pin
Chen Jiadong11-Nov-02 4:47
Chen Jiadong11-Nov-02 4:47 
GeneralCursor change Pin
Dennis L11-Nov-02 1:58
Dennis L11-Nov-02 1:58 
GeneralRe: Cursor change Pin
KarstenK11-Nov-02 2:20
mveKarstenK11-Nov-02 2:20 
GeneralRe: Cursor change Pin
vgkotha11-Nov-02 4:25
vgkotha11-Nov-02 4:25 
GeneralRe: Cursor change Pin
Anonymous11-Nov-02 5:02
Anonymous11-Nov-02 5:02 
GeneralRe: Cursor change Pin
jhwurmbach11-Nov-02 22:14
jhwurmbach11-Nov-02 22:14 
GeneralRe: Cursor change Pin
georgiek5012-Nov-02 4:02
georgiek5012-Nov-02 4:02 
GeneralAdding a pane to the Status Bar. Pin
WREY11-Nov-02 1:29
WREY11-Nov-02 1:29 
GeneralRe: Adding a pane to the Status Bar. Pin
Anonymous11-Nov-02 1:54
Anonymous11-Nov-02 1:54 
General??? error Pin
Anonymous11-Nov-02 1:19
Anonymous11-Nov-02 1:19 
GeneralRe: ??? error Pin
WREY11-Nov-02 1:34
WREY11-Nov-02 1:34 
GeneralRe: ??? error Pin
Anonymous11-Nov-02 1:46
Anonymous11-Nov-02 1:46 
GeneralRe: ??? error Pin
WREY11-Nov-02 2:33
WREY11-Nov-02 2:33 
GeneralRe: ??? error Pin
Tim Smith11-Nov-02 3:52
Tim Smith11-Nov-02 3:52 
GeneralRe: ??? error Pin
cradle11-Nov-02 1:37
cradle11-Nov-02 1:37 
GeneralRe: ??? error Pin
Anonymous11-Nov-02 2:23
Anonymous11-Nov-02 2:23 
Questionwhat can happen? (Creating controls on the fly with the same resource name...) Pin
Joan M11-Nov-02 1:15
professionalJoan M11-Nov-02 1:15 

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.