home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / msmqocm.cab / DISDRAW.CPP < prev    next >
C/C++ Source or Header  |  1997-10-06  |  2KB  |  91 lines

  1. // disdraw.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "disdraw.h"
  6. #include "drawdlg.h"
  7. #include "logindlg.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. #define MAX_USERNAME_LEN 32
  16.  
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CDisdrawApp
  19.  
  20. BEGIN_MESSAGE_MAP(CDisdrawApp, CWinApp)
  21.     //{{AFX_MSG_MAP(CDisdrawApp)
  22.         // NOTE - the ClassWizard will add and remove mapping macros here.
  23.         //    DO NOT EDIT what you see in these blocks of generated code!
  24.     //}}AFX_MSG
  25.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  26. END_MESSAGE_MAP()
  27.  
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CDisdrawApp construction
  30.  
  31. CDisdrawApp::CDisdrawApp()
  32. {
  33.     // TODO: add construction code here,
  34.     // Place all significant initialization in InitInstance
  35. }
  36.  
  37. /////////////////////////////////////////////////////////////////////////////
  38. // The one and only CDisdrawApp object
  39.  
  40. CDisdrawApp theApp;
  41.  
  42. /////////////////////////////////////////////////////////////////////////////
  43. // CDisdrawApp initialization
  44.  
  45. BOOL CDisdrawApp::InitInstance()
  46. {
  47.     // Standard initialization
  48.     // If you are not using these features and wish to reduce the size
  49.     //  of your final executable, you should remove from the following
  50.     //  the specific initialization routines you do not need.
  51.  
  52. #ifdef _AFXDLL
  53.     Enable3dControls();            // Call this when using MFC in a shared DLL
  54. #else
  55.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  56. #endif
  57.  
  58.     //
  59.     // Prompt for the user's name
  60.     //
  61.     char mbsUserName[MAX_USERNAME_LEN];
  62.     DWORD dwNumBytes = MAX_USERNAME_LEN;
  63.     GetUserName(mbsUserName, &dwNumBytes);
  64.     CLoginDlg dlgLogin;
  65.     dlgLogin.m_strLogin = mbsUserName;
  66.     if (dlgLogin.DoModal() == IDCANCEL)
  67.     {
  68.         return FALSE;
  69.     }
  70.     dlgLogin.m_strLogin.MakeUpper();
  71.  
  72.     CDisdrawDlg dlg;
  73.     m_pMainWnd = &dlg;
  74.     dlg.m_strLogin = dlgLogin.m_strLogin;
  75.     int nResponse = dlg.DoModal();
  76.     if (nResponse == IDOK)
  77.     {
  78.         // TODO: Place code here to handle when the dialog is
  79.         //  dismissed with OK
  80.     }
  81.     else if (nResponse == IDCANCEL)
  82.     {
  83.         // TODO: Place code here to handle when the dialog is
  84.         //  dismissed with Cancel
  85.     }
  86.  
  87.     // Since the dialog has been closed, return FALSE so that we exit the
  88.     //  application, rather than start the application's message pump.
  89.     return FALSE;
  90. }
  91.