Click here to Skip to main content
16,014,303 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Formating text from a .txt file Pin
Nish Nishant1-Jun-02 23:21
sitebuilderNish Nishant1-Jun-02 23:21 
GeneralRe: Formating text from a .txt file Pin
1-Jun-02 23:59
suss1-Jun-02 23:59 
GeneralRe: Formating text from a .txt file Pin
Nish Nishant2-Jun-02 0:11
sitebuilderNish Nishant2-Jun-02 0:11 
GeneralRe: Formating text from a .txt file Pin
2-Jun-02 7:27
suss2-Jun-02 7:27 
Generalviews from menu Pin
ram9712311-Jun-02 21:45
ram9712311-Jun-02 21:45 
GeneralRe: views from menu Pin
Joel Holdsworth1-Jun-02 22:38
Joel Holdsworth1-Jun-02 22:38 
GeneralAnother Question Pin
Joel Holdsworth1-Jun-02 20:46
Joel Holdsworth1-Jun-02 20:46 
GeneralRe: Another Question Pin
Bugra Barin1-Jun-02 22:09
Bugra Barin1-Jun-02 22:09 
1. How do I get pointers to the document?

Say you have these classes:
Application class : CMyApp
Main frame class : CMainFrame
MDI child frame class : CChildFrame
Document class : CMyDoc

// to get the active document
CMyApp* pApp = (CMyApp*)AfxGetApp();
CMainFrame* pwnd = (CMainFrame*)pApp->GetMainWnd();
CChildFrame* pChild = (CChildFrame*) pwnd->MDIGetActive();
CMyDoc* pDoc = (CMyDoc*) pChild->GetActiveDocument();

Not pretty but you could wrap this in a function.

2. How can I get my docking view to respond when the active document changes?
I would try to override OnActivateView of the view class and do the processing based on which view (thus document) is being activated or deactivated.

3. would I be better off using SDI?
I would say Yes. MDI is nice but it can be a royal pain in the neck if you are a rookie like me trying to write a big app. Also I read somewhere that the average computer user finds multiple documents too confusing.


GeneralRe: Another Question Pin
Joel Holdsworth1-Jun-02 22:25
Joel Holdsworth1-Jun-02 22:25 
General"stdafx.h" Pin
WREY1-Jun-02 16:55
WREY1-Jun-02 16:55 
GeneralRe: "stdafx.h" Pin
Nish Nishant1-Jun-02 18:05
sitebuilderNish Nishant1-Jun-02 18:05 
GeneralRe: "stdafx.h" Pin
WREY1-Jun-02 20:39
WREY1-Jun-02 20:39 
GeneralRe: "stdafx.h" Pin
Joel Holdsworth1-Jun-02 21:04
Joel Holdsworth1-Jun-02 21:04 
GeneralRe: "stdafx.h" Pin
WREY1-Jun-02 21:43
WREY1-Jun-02 21:43 
GeneralRe: "stdafx.h" Pin
Brian Delahunty2-Jun-02 4:59
Brian Delahunty2-Jun-02 4:59 
GeneralAnimateWindow(), problem Pin
MaTrIX2k21-Jun-02 11:16
MaTrIX2k21-Jun-02 11:16 
GeneralRe: AnimateWindow(), problem Pin
Paul M Watt1-Jun-02 18:09
mentorPaul M Watt1-Jun-02 18:09 
GeneralRe: AnimateWindow(), problem Pin
MaTrIX2k21-Jun-02 18:49
MaTrIX2k21-Jun-02 18:49 
GeneralDetecting connections... Pin
einst9921-Jun-02 10:30
einst9921-Jun-02 10:30 
GeneralRe: Detecting connections... Pin
Rama Krishna Vavilala1-Jun-02 12:19
Rama Krishna Vavilala1-Jun-02 12:19 
QuestionWhere can I get masm? Pin
1-Jun-02 10:29
suss1-Jun-02 10:29 
AnswerRe: Where can I get masm? Pin
Tim Smith1-Jun-02 10:38
Tim Smith1-Jun-02 10:38 
GeneralRe: Where can I get masm? Pin
1-Jun-02 10:53
suss1-Jun-02 10:53 
AnswerRe: Where can I get masm? Pin
Nish Nishant1-Jun-02 18:14
sitebuilderNish Nishant1-Jun-02 18:14 
AnswerRe: Where can I get masm? Pin
David_LoveCpp17-Mar-10 22:32
David_LoveCpp17-Mar-10 22:32 

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.