Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CWinApp::m_lpCmdLine
Collapse the table of content
Expand the table of content

CWinApp::m_lpCmdLine

Corresponds to the lpCmdLine parameter passed by Windows to WinMain.

LPTSTR m_lpCmdLine;

Points to a null-terminated string that specifies the command line for the application. Use m_lpCmdLine to access any command-line arguments the user entered when the application was started. m_lpCmdLine is a public variable of type LPTSTR.

if (m_lpCmdLine[0] == _T('\0'))
{
   // Create a new (empty) document.
   OnFileNew();
}
else
{
   // Open a file passed as the first command line parameter.
   OpenDocumentFile(m_lpCmdLine);
}

Header: afxwin.h

Show:
© 2015 Microsoft