home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / mslang / poetmf / src / queryres.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-23  |  2.1 KB  |  87 lines

  1. // ******************************************************************
  2. //
  3. // queryres.cpp : implementation file
  4. // 
  5. //    Implemented classes:
  6. //        CQueryResultDlg
  7. //
  8. //    Author:    Nils Behncke 
  9. //            POET Software, August 1993    
  10. //
  11. // ******************************************************************
  12.  
  13. #include <stdafx.h>        //    header to MFC
  14. #include <queryres.h>    //    header to this file
  15.  
  16. #ifdef _DEBUG        //    added by ClassWizard
  17. #undef THIS_FILE
  18. static char BASED_CODE THIS_FILE[] = __FILE__;
  19. #endif
  20.  
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CQueryResultDlg dialog
  23.  
  24. CQueryResultDlg::CQueryResultDlg(CWnd* pParent /*=NULL*/)
  25.     : CDialog(CQueryResultDlg::IDD, pParent)
  26. {
  27.     //{{AFX_DATA_INIT(CQueryResultDlg)
  28.         // NOTE: the ClassWizard will add member initialization here
  29.     //}}AFX_DATA_INIT
  30. }
  31.  
  32. CQueryResultDlg::~CQueryResultDlg ()
  33. {
  34. }
  35.  
  36.  
  37. void CQueryResultDlg::DoDataExchange(CDataExchange* pDX)
  38. {
  39.     CDialog::DoDataExchange(pDX);
  40.     //{{AFX_DATA_MAP(CQueryResultDlg)
  41.     DDX_Control(pDX, IDC_LIST_RESULT, m_CListResult);
  42.     //}}AFX_DATA_MAP
  43. }
  44.  
  45. BEGIN_MESSAGE_MAP(CQueryResultDlg, CDialog)
  46.     //{{AFX_MSG_MAP(CQueryResultDlg)
  47.     //}}AFX_MSG_MAP
  48. END_MESSAGE_MAP()
  49.  
  50.  
  51. void CQueryResultDlg::Init ()
  52. {
  53.     int        erc;
  54.  
  55.     for ( erc = presult->Seek ( 0L, PtSTART ); erc == 0; )
  56.        {
  57.         PersonOnDemand    ondem;
  58.         if ((erc = presult->Get ( ondem ) ) == 0 )
  59.            {
  60.             char    buffer[500];
  61.             
  62.             if ((erc = ondem.Get (person)) == 0)    //    get Person or Programmer
  63.                {
  64.                 m_CListResult.AddString (CString (person->Print ( buffer ) ));    //    add to Listbox    
  65.                 ondem.Unget (person);
  66.                }
  67.  
  68.             presult->Unget ( ondem );
  69.             erc = presult->Seek ( 1L, PtCURRENT );
  70.            }
  71.        }
  72. }    
  73.  
  74. /////////////////////////////////////////////////////////////////////////////
  75. // CQueryResultDlg message handlers
  76.  
  77. BOOL CQueryResultDlg::OnInitDialog()
  78. {
  79.     CDialog::OnInitDialog();
  80.  
  81.     Init ();    // set result in Listbox
  82.     
  83.     return TRUE;  // return TRUE  unless you set the focus to a control
  84. }
  85.  
  86. //    OK and CANCEL button with standard-IDs like IDOK or IDCANCEL automaticly handled
  87.