[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1282
  • Last Modified:

AfxGetMainFrame

Hello,
I want to get a pointer to the CMainFrame, the code is like this:

CMainFrame* pFrame = (CMainFrame*)AfxGetMainFrame();

but it is giving error that is:
AfxGetMainFrame' : undeclared identifier

Can anybody help?
Saqib
0
jhapak
Asked:
jhapak
1 Solution
 
Jaime OlivaresSoftware ArchitectCommented:
Correct function is AfxGetMainWnd():

CMainFrame* pFrame = (CMainFrame*)AfxGetMainWnd();

It returns the m_pMainWnd member of the current CWinApp object.

Have a look to:
http://msdn.microsoft.com/library/en-us/vclib/html/_MFC_afxGetMainWnd.asp
0
 
jhapakAuthor Commented:
you got the points
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now