Click here to Skip to main content
15,921,779 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: i Still in Trouble! plz Help me to release Pin
l a u r e n9-Jan-03 9:56
l a u r e n9-Jan-03 9:56 
GeneralShame on me !!! it's not worked yet !! Pin
Alex H 19839-Jan-03 10:05
Alex H 19839-Jan-03 10:05 
GeneralRe: Shame on me !!! it's not worked yet !! Pin
l a u r e n9-Jan-03 10:20
l a u r e n9-Jan-03 10:20 
GeneralRe: Shame on me !!! it's not worked yet !! Pin
uandrej9-Jan-03 10:44
uandrej9-Jan-03 10:44 
GeneralRe: Shame on me !!! it's not worked yet !! Pin
Alex H 19839-Jan-03 19:36
Alex H 19839-Jan-03 19:36 
GeneralRe: Shame on me !!! it's not worked yet !! Pin
9-Jan-03 21:33
suss9-Jan-03 21:33 
GeneralRe: Shame on me !!! it's not worked yet !! Pin
KaЯl10-Jan-03 0:13
KaЯl10-Jan-03 0:13 
GeneralAp Pin
KaЯl10-Jan-03 0:22
KaЯl10-Jan-03 0:22 
I'm not sure you need a global pointer, MFC gives all the methods needed to access its objects.

I suppose you are using the document-view architecture, and CDemoView is the view class of the application.

You can get a pointer on your main frame using

CMainFrame *pMyFrame = (CMainFrame *)AfxGetApp()->m_pMainWnd;

Your app being SDI, you can get the active view from the main frame using:

CDemoView *pView = (CDemoView *)pMyFrame->GetActiveView();

(because when using print preview the active view may be the preview view instead of your view, you should perhaps make the following test

CDemoView *pView = (CDemoView *)pMyFrame>GetActiveView();<br />
if(!pView || pView->IsKindOf(RUNTIME_CLASS(CDemoView))<br />
     return;


Another way, perhaps safer, is to get the active document from the MainFrame (CDocument *CFrameWnd::GetActiveDocument) and then, from the document, accessing the view(s) it may own (CDocument::GetFirstViewPosition, CDocument::GetNextView)


HTH,

K.







Angels banished from heaven have no choice but to become demons

Cowboy Bebop

GeneralRe: Ap Pin
Alex H 198310-Jan-03 1:32
Alex H 198310-Jan-03 1:32 
GeneralRe: Ap Pin
KaЯl10-Jan-03 1:47
KaЯl10-Jan-03 1:47 
GeneralRe: Ap Pin
Alex H 198310-Jan-03 8:01
Alex H 198310-Jan-03 8:01 
GeneralRe: i Still in Trouble! plz Help me to release Pin
KaЯl10-Jan-03 0:11
KaЯl10-Jan-03 0:11 
Generala question about dll's... Pin
l a u r e n9-Jan-03 8:21
l a u r e n9-Jan-03 8:21 
GeneralRe: a question about dll's... Pin
Alvaro Mendez9-Jan-03 8:39
Alvaro Mendez9-Jan-03 8:39 
GeneralRe: a question about dll's... Pin
l a u r e n9-Jan-03 9:03
l a u r e n9-Jan-03 9:03 
GeneralRe: a question about dll's... Pin
David Stone9-Jan-03 11:51
sitebuilderDavid Stone9-Jan-03 11:51 
GeneralRe: a question about dll's... Pin
Shog99-Jan-03 13:04
sitebuilderShog99-Jan-03 13:04 
GeneralSSE Pin
peter27139-Jan-03 7:49
peter27139-Jan-03 7:49 
GeneralRe: SSE Pin
l a u r e n9-Jan-03 8:26
l a u r e n9-Jan-03 8:26 
GeneralRe: SSE Pin
peter27139-Jan-03 8:51
peter27139-Jan-03 8:51 
GeneralRe: SSE Pin
l a u r e n9-Jan-03 8:58
l a u r e n9-Jan-03 8:58 
GeneralRe: SSE Pin
peter27139-Jan-03 9:26
peter27139-Jan-03 9:26 
GeneralRe: SSE Pin
geo_m9-Jan-03 9:12
geo_m9-Jan-03 9:12 
QuestionRelease mode exception? Pin
clintsinger9-Jan-03 7:46
clintsinger9-Jan-03 7:46 
AnswerThe main thing is to create pdbs for release build Pin
AlexO9-Jan-03 8:03
AlexO9-Jan-03 8:03 

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.