CWinApp::OpenDocumentFile
Visual Studio 2012
The framework calls this method to open the named CDocument file for the application.
virtual CDocument* OpenDocumentFile( LPCTSTR lpszFileName BOOL bAddToMRU = TRUE );
If a document that has that name is already open, the first frame window that contains that document will get the focus. If an application supports multiple document templates, the framework uses the file name extension to find the appropriate document template to try to load the document. If successful, the document template then creates a frame window and view for the document.