home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Troubleshooting Netware Systems
/
CSTRIAL0196.BIN
/
attach
/
msj
/
v10n03
/
bocole.exe
/
MDI.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-01
|
3KB
|
122 lines
// mdi.cpp : Defines the class behaviors for the application.
//
// This is a part of the Microsoft Foundation Classes C++ library.
// Copyright (C) 1992 Microsoft Corporation
// All rights reserved.
//
// This source code is only intended as a supplement to the
// Microsoft Foundation Classes Reference and Microsoft
// QuickHelp and/or WinHelp documentation provided with the library.
// See these sources for detailed information regarding the
// Microsoft Foundation Classes product.
#include "stdafx.h"
#include "mdi.h"
#include "ocf4mfc.h"
#include "mainfrm.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
//
// OCF variables
//
TRegLink* RegLinkHead = 0;
TOleInit* OleInit = 0;
//
// OLE Registration information
//
REGISTRATION_FORMAT_BUFFER(100)
BEGIN_REGISTRATION(AppReg)
REGDATA(clsid, "{2C27A720-D323-101B-96B9-7A117CB6AF38}")
REGDATA(progid, "MFCMDI.ProgID.1")
REGDATA(description, "MFC Sample using OCF")
END_REGISTRATION
/////////////////////////////////////////////////////////////////////////////
// CMdiApp
BEGIN_MESSAGE_MAP(CMdiApp, CWinApp)
//{{AFX_MSG_MAP(CMdiApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMdiApp construction
// Place all significant initialization in InitInstance
CMdiApp::CMdiApp()
{
try {
OleInit = new TOleInit(::AppReg,
/*Factory Callback*/0,
string(m_lpCmdLine),
::RegLinkHead,
m_hInstance);
}
catch (TXBase& xbase) {
MessageBox(GetFocus(), xbase.why().c_str(), "Exception caught", MB_OK);
}
}
CMdiApp::~CMdiApp()
{
delete OleInit;
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CMdiApp object
CMdiApp NEAR theApp;
/////////////////////////////////////////////////////////////////////////////
// CMdiApp initialization
BOOL CMdiApp::InitInstance()
{
SetDialogBkColor();
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
m_pMainWnd = pMainFrame;
// load the two static menus
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMdiApp commands
void CMdiApp::OnAppAbout()
{
CDialog(IDD_ABOUTBOX).DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// other globals
// Color array maps to Color menu
COLORREF NEAR colorArray[] =
{
RGB (0, 0, 0),
RGB (255, 0, 0),
RGB (0, 255, 0),
RGB (0, 0, 255),
RGB (255, 255, 255)
};
/////////////////////////////////////////////////////////////////////////////