Annotation of mstools/mfc/samples/multipad/mpinit.cpp, revision 1.1.1.2

1.1       root        1: // mpinit.cpp : Defines the application initialization.
                      2: //
                      3: // This is a part of the Microsoft Foundation Classes C++ library.
                      4: // Copyright (C) 1992 Microsoft Corporation
                      5: // All rights reserved.
                      6: //
                      7: // This source code is only intended as a supplement to the
                      8: // Microsoft Foundation Classes Reference and Microsoft
                      9: // QuickHelp documentation provided with the library.
                     10: // See these sources for detailed information regarding the
                     11: // Microsoft Foundation Classes product.
                     12: 
                     13: #include "multipad.h"
                     14: 
1.1.1.2 ! root       15: #ifndef _NTWIN
1.1       root       16: #pragma code_seg("_MPINIT")
1.1.1.2 ! root       17: #endif
1.1       root       18: 
                     19: // InitInstance:
                     20: // Does the typical printer and frame initialization, as well as loading a
                     21: // file if one is listed on the command line.  Note that only one filename
                     22: // on the command line is currently supported.
                     23: //
                     24: BOOL CMultiPad::InitInstance()
                     25: {
                     26:        extern void LoadMRU();
                     27:        extern CPrinter* thePrinter;
                     28:        char szCmdLine[128];
                     29:        char* pCmdLine;
                     30:        
                     31:        LoadMRU();
                     32:        
                     33:        // Create the frame.
                     34:        //
                     35:        m_pMainWnd = new CMPFrame(m_pszAppName);
                     36:        if (m_pMainWnd->m_hWnd == NULL)
                     37:                return FALSE;
                     38:        
                     39:        // Create the printer object
                     40:        thePrinter = new CPrinter;
                     41: 
                     42:        // Load main menu accelerators.
                     43:        //
                     44:        if (!CMPFrame::GetMDIFrameWnd()->LoadAccelTable(MAKEINTRESOURCE(IDMULTIPAD)))
                     45:                return FALSE;
                     46: 
                     47:        // Display the frame window.
                     48:        //
                     49:        m_pMainWnd->ShowWindow(m_nCmdShow);
                     50:        m_pMainWnd->UpdateWindow();
                     51:        
                     52:        // If the command line string is empty, nullify the pointer to it,
                     53:        // otherwise copy command line into our data segment.
                     54:        //
                     55:        if (m_lpCmdLine == NULL || m_lpCmdLine[0] == '\0')
                     56:        {
                     57:                pCmdLine = NULL;
                     58:        }
                     59:        else
                     60:        {
                     61:                pCmdLine = szCmdLine;
                     62:                lstrcpy(pCmdLine, m_lpCmdLine);
                     63:        }
                     64:        
                     65:        // Add the first MDI window.
                     66:        //
                     67:        new CMPChild(pCmdLine);
                     68: 
                     69:        return TRUE;
                     70: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.