Initialization part in SDI MFC project.
-
Hi, I am changing my dialog based MFC application to SDI application. I have the initialization code in TestDlg::OnInitDialog(), in the part //TODO: Add extra initialization here What is the equivalent function in SDI? Where can I add this extra initialization? I see CAppView::OnInitalUpdate() function, but there isn't //TODO: Add extra initialization here comment. Thanks, Harsha
-
Hi, I am changing my dialog based MFC application to SDI application. I have the initialization code in TestDlg::OnInitDialog(), in the part //TODO: Add extra initialization here What is the equivalent function in SDI? Where can I add this extra initialization? I see CAppView::OnInitalUpdate() function, but there isn't //TODO: Add extra initialization here comment. Thanks, Harsha
One such place is the document's
OnOpenDocument()
method, or the view'sOnInitialUpdate()
method. It really just depends on what it is that you are initializing.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
-
Hi, I am changing my dialog based MFC application to SDI application. I have the initialization code in TestDlg::OnInitDialog(), in the part //TODO: Add extra initialization here What is the equivalent function in SDI? Where can I add this extra initialization? I see CAppView::OnInitalUpdate() function, but there isn't //TODO: Add extra initialization here comment. Thanks, Harsha
-
One such place is the document's
OnOpenDocument()
method, or the view'sOnInitialUpdate()
method. It really just depends on what it is that you are initializing.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
Hi, Thank you. I am adding the initialization code related to the controls I have added on IDD_APP_FORM (Dialog). So I guess I should add initialization code to view's OnInitialUpdate() method. In which case document's OnOpenDocument() method is used? Thanks, Harsha
-
Hi, Thank you. I am adding the initialization code related to the controls I have added on IDD_APP_FORM (Dialog). So I guess I should add initialization code to view's OnInitialUpdate() method. In which case document's OnOpenDocument() method is used? Thanks, Harsha
harsha1305 wrote:
In which case document's OnOpenDocument() method is used?
When you want to reinitialize the existing
CDocument
object, rather than create a new one.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb