Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
Visual C++
MFC
 AfxGetApp

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2008/.NET Framework 3.5

Other versions are also available for the following:
MFC Library Reference
AfxGetApp

The pointer returned by this function can be used to access application information such as the main message-dispatch code or the topmost window.

CWinApp* AFXAPI AfxGetApp( ); 

A pointer to the single CWinApp object for the application.

Visual C++
// Print the application's executable filename.
TRACE(_T("Executable filename = %s\n"), AfxGetApp()->m_pszExeName);

Header: afxwin.h

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker