|
-
May 23rd, 2002, 12:25 PM
#1
Problem with GetFirstDocTemplatePosition function
Hi,
i'm developing a MDI application with two CMultiDocTemplate. In the View class of one of them, i want to access one of these CMultidocTemplate using this command:
CEVPlayerApp* pMain = (CEVPlayerApp*)AfxGetApp()->m_pMainWnd;
POSITION posTemplate = (POSITION)pMain->GetFirstDocTemplatePosition();
But when i run it, i've a dialog box saying that the memory canno't be read, even if i doesn't have compilation error.
Does anybody have an idea about it ?
Thanks in advance.
Your response will be rated.
-
May 23rd, 2002, 12:29 PM
#2
Well how abt using
AfxGetApp()->GetFirstDocTemplatePosition() ??
Since it is a member fn of CWinApp.
-
May 23rd, 2002, 12:30 PM
#3
Remove "->m_pMainWnd" and it should work. You were trying to get the main window and cast it ta an application object. That's why it chrashes.
regards,
MiMec
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|