home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / pserv.cpl / pserv-2.4.exe / source / RemoteConnectDialog.cpp < prev    next >
C/C++ Source or Header  |  2005-01-05  |  2KB  |  72 lines

  1. // RemoteConnectDialog.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "pserv2.h"
  6. #include "RemoteConnectDialog.h"
  7. #include "CConfiguration.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. void DDX_ExchangeComboArray(CDataExchange* pDX, CComboBox& combobox, CStringArray& stringarray)
  16. {
  17.     if( pDX->m_bSaveAndValidate )
  18.     {
  19.         CString current;
  20.         combobox.GetWindowText(current);
  21.         for( int nIndex = 0, nMaxIndex = stringarray.GetSize(); nIndex < nMaxIndex; nIndex++ )
  22.         {
  23.             if( stringarray.GetAt(nIndex).Compare(current) == 0 )
  24.             {
  25.                 stringarray.RemoveAt(nIndex);
  26.                 break;
  27.             }
  28.         }
  29.         stringarray.InsertAt(0, current);
  30.     }
  31.     else
  32.     {
  33.         for( int nIndex = 0, nMaxIndex = stringarray.GetSize(); nIndex < nMaxIndex; nIndex++ )
  34.         {
  35.             combobox.InsertString(nIndex, stringarray.GetAt(nIndex) );   
  36.         }
  37.         combobox.SetCurSel(0);
  38.     }
  39. }
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. // CRemoteConnectDialog dialog
  43.  
  44.  
  45. CRemoteConnectDialog::CRemoteConnectDialog(CWnd* pParent /*=NULL*/)
  46.     : CDialog(CRemoteConnectDialog::IDD, pParent)
  47. {
  48.     //{{AFX_DATA_INIT(CRemoteConnectDialog)
  49.         // NOTE: the ClassWizard will add member initialization here
  50.     //}}AFX_DATA_INIT
  51. }
  52.  
  53.  
  54. void CRemoteConnectDialog::DoDataExchange(CDataExchange* pDX)
  55. {
  56.     CDialog::DoDataExchange(pDX);
  57.     //{{AFX_DATA_MAP(CRemoteConnectDialog)
  58.     DDX_Control(pDX, IDC_COMPUTER_NAME, m_cbComputerName);
  59.     //}}AFX_DATA_MAP
  60.     DDX_ExchangeComboArray(pDX, m_cbComputerName, theConfiguration.m_ComputerNames );
  61. }
  62.  
  63.  
  64. BEGIN_MESSAGE_MAP(CRemoteConnectDialog, CDialog)
  65.     //{{AFX_MSG_MAP(CRemoteConnectDialog)
  66.         // NOTE: the ClassWizard will add message map macros here
  67.     //}}AFX_MSG_MAP
  68. END_MESSAGE_MAP()
  69.  
  70. /////////////////////////////////////////////////////////////////////////////
  71. // CRemoteConnectDialog message handlers
  72.