MyMonitor.cpp
上传用户:deligs
上传日期:2007-01-08
资源大小:43k
文件大小:3k
- // MyMonitor.cpp : Defines the class behaviors for the application.
- //
- #include "stdafx.h"
- #include "MyMonitor.h"
- #include "MainFrm.h"
- #include "Splash.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CMyMonitorApp
- BEGIN_MESSAGE_MAP(CMyMonitorApp, CWinApp)
- //{{AFX_MSG_MAP(CMyMonitorApp)
- //}}AFX_MSG_MAP
- // Standard file based document commands
- ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
- ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CMyMonitorApp construction
- CMyMonitorApp::CMyMonitorApp()
- {
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
- }
- /////////////////////////////////////////////////////////////////////////////
- // The one and only CMyMonitorApp object
- CMyMonitorApp theApp;
- /////////////////////////////////////////////////////////////////////////////
- // CMyMonitorApp initialization
- BOOL CMyMonitorApp::InitInstance()
- {
- // CG: The following block was added by the Splash Screen component.
{
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
CSplashWnd::EnableSplashScreen(cmdInfo.m_bShowSplash);
}
- // Enable Socket support
- if (!AfxSocketInit())
- {
- AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
- return FALSE;
- }
- // Standard initialization
- // If you are not using these features and wish to reduce the size
- // of your final executable, you should remove from the following
- // the specific initialization routines you do not need.
- #ifdef _AFXDLL
- Enable3dControls(); // Call this when using MFC in a shared DLL
- #else
- Enable3dControlsStatic(); // Call this when linking to MFC statically
- #endif
- // Change the registry key under which our settings are stored.
- // TODO: You should modify this string to be something appropriate
- // such as the name of your company or organization.
- SetRegistryKey(_T("UDP Test :)"));
- // To create the main window, this code creates a new frame window
- // object and then sets it as the application's main window object.
- CMainFrame* pFrame = new CMainFrame;
- m_pMainWnd = pFrame;
- // create and load the frame with its resources
- pFrame->LoadFrame(IDR_MAINFRAME,
- WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
- NULL);
- LoadStdProfileSettings(); // Load standard INI file options (including MRU)
- // The one and only window has been initialized
- m_pMainWnd->ShowWindow(SW_HIDE); // Hide it, so you cannot see it on the desktop
- m_pMainWnd->UpdateWindow();
- return TRUE;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CMyMonitorApp message handlers
- BOOL CMyMonitorApp::PreTranslateMessage(MSG* pMsg)
- {
- // CG: The following lines were added by the Splash Screen component.
if (CSplashWnd::PreTranslateAppMessage(pMsg))
return TRUE;
return CWinApp::PreTranslateMessage(pMsg);
- }