MyMonitor.cpp
上传用户:deligs
上传日期:2007-01-08
资源大小:43k
文件大小:3k
源码类别:

网络编程

开发平台:

Visual C++

  1. // MyMonitor.cpp : Defines the class behaviors for the application.
  2. //
  3. #include "stdafx.h"
  4. #include "MyMonitor.h"
  5. #include "MainFrm.h"
  6. #include "Splash.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CMyMonitorApp
  14. BEGIN_MESSAGE_MAP(CMyMonitorApp, CWinApp)
  15. //{{AFX_MSG_MAP(CMyMonitorApp)
  16. //}}AFX_MSG_MAP
  17. // Standard file based document commands
  18. ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  19. ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  20. END_MESSAGE_MAP()
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CMyMonitorApp construction
  23. CMyMonitorApp::CMyMonitorApp()
  24. {
  25. // TODO: add construction code here,
  26. // Place all significant initialization in InitInstance
  27. }
  28. /////////////////////////////////////////////////////////////////////////////
  29. // The one and only CMyMonitorApp object
  30. CMyMonitorApp theApp;
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CMyMonitorApp initialization
  33. BOOL CMyMonitorApp::InitInstance()
  34. {
  35. // CG: The following block was added by the Splash Screen component. { CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); CSplashWnd::EnableSplashScreen(cmdInfo.m_bShowSplash); }
  36. // Enable Socket support
  37. if (!AfxSocketInit())
  38. {
  39. AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
  40. return FALSE;
  41. }
  42. // Standard initialization
  43. // If you are not using these features and wish to reduce the size
  44. //  of your final executable, you should remove from the following
  45. //  the specific initialization routines you do not need.
  46. #ifdef _AFXDLL
  47. Enable3dControls(); // Call this when using MFC in a shared DLL
  48. #else
  49. Enable3dControlsStatic(); // Call this when linking to MFC statically
  50. #endif
  51. // Change the registry key under which our settings are stored.
  52. // TODO: You should modify this string to be something appropriate
  53. // such as the name of your company or organization.
  54. SetRegistryKey(_T("UDP Test :)"));
  55. // To create the main window, this code creates a new frame window
  56. // object and then sets it as the application's main window object.
  57. CMainFrame* pFrame = new CMainFrame;
  58. m_pMainWnd = pFrame;
  59. // create and load the frame with its resources
  60. pFrame->LoadFrame(IDR_MAINFRAME,
  61. WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
  62. NULL);
  63. LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  64. // The one and only window has been initialized
  65. m_pMainWnd->ShowWindow(SW_HIDE); // Hide it, so you cannot see it on the desktop
  66. m_pMainWnd->UpdateWindow();
  67. return TRUE;
  68. }
  69. /////////////////////////////////////////////////////////////////////////////
  70. // CMyMonitorApp message handlers
  71. BOOL CMyMonitorApp::PreTranslateMessage(MSG* pMsg)
  72. {
  73. // CG: The following lines were added by the Splash Screen component. if (CSplashWnd::PreTranslateAppMessage(pMsg)) return TRUE; return CWinApp::PreTranslateMessage(pMsg);
  74. }