home *** CD-ROM | disk | FTP | other *** search
/ Game Programming in C++ - Start to Finish / GameProgrammingS.iso / developer_install / ReplicaNetFreewareV5_4.exe / data1.cab / Program_Executable_Files / Example5 / Example5.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-30  |  2.1 KB  |  79 lines

  1. /* START_LICENSE_HEADER
  2.  
  3. Copyright (C) 2000 Martin Piper, original design and program code
  4. Copyright (C) 2001-2005 Replica Software
  5.  
  6. This program file is copyright (C) Replica Software and can only be used under license.
  7. For more information visit: http://www.replicanet.com/
  8. Or email: info@replicanet.com
  9.  
  10. END_LICENSE_HEADER */
  11. // Example5.cpp : Defines the class behaviors for the application.
  12. //
  13.  
  14. #include "stdafx.h"
  15. #include "Example5.h"
  16. #include "Example5Dlg.h"
  17. #include "ChatDlg.h"
  18.  
  19. #ifdef _DEBUG
  20. #define new DEBUG_NEW
  21. #undef THIS_FILE
  22. static char THIS_FILE[] = __FILE__;
  23. #endif
  24.  
  25. using namespace RNReplicaNet;
  26.  
  27.  
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CExample5App
  30.  
  31. BEGIN_MESSAGE_MAP(CExample5App, CWinApp)
  32.     //{{AFX_MSG_MAP(CExample5App)
  33.         // NOTE - the ClassWizard will add and remove mapping macros here.
  34.         //    DO NOT EDIT what you see in these blocks of generated code!
  35.     //}}AFX_MSG
  36.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  37. END_MESSAGE_MAP()
  38.  
  39. /////////////////////////////////////////////////////////////////////////////
  40. // CExample5App construction
  41.  
  42. CExample5App::CExample5App()
  43. {
  44.     // TODO: add construction code here,
  45.     // Place all significant initialization in InitInstance
  46. }
  47.  
  48. /////////////////////////////////////////////////////////////////////////////
  49. // The one and only CExample5App object
  50.  
  51. CExample5App theApp;
  52.  
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CExample5App initialization
  55.  
  56. BOOL CExample5App::InitInstance()
  57. {
  58.     AfxEnableControlContainer();
  59.  
  60.     mXPSession = XPSession::Allocate();
  61.  
  62. #ifdef _AFXDLL
  63.     Enable3dControls();            // Call this when using MFC in a shared DLL
  64. #else
  65.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  66. #endif
  67.  
  68.     // Open the server select dialog
  69.     CExample5Dlg dlg;
  70.     m_pMainWnd = &dlg;
  71.     int nResponse = dlg.DoModal();
  72.  
  73.     delete mXPSession;
  74.  
  75.     // Since the dialog has been closed, return FALSE so that we exit the
  76.     //  application, rather than start the application's message pump.
  77.     return FALSE;
  78. }
  79.