usrfounddlg.cpp

来自「聊天程序」· C++ 代码 · 共 84 行

CPP
84
字号
// UsrFoundDlg.cpp : implementation file
//

#include "stdafx.h"
#include "MICQWin32x.h"
#include "UsrFoundDlg.h"

#include "MICQComponents.h"

#include "AddUserDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CUsrFoundDlg dialog


CUsrFoundDlg::CUsrFoundDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CUsrFoundDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CUsrFoundDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CUsrFoundDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CUsrFoundDlg)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CUsrFoundDlg, CDialog)
	//{{AFX_MSG_MAP(CUsrFoundDlg)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CUsrFoundDlg message handlers

void CUsrFoundDlg::OnOK() 
{
	// TODO: Add extra validation here
	
	CDialog::OnOK();
	int pos;
	CListBox* userFound = (CListBox*)GetDlgItem(IDC_FOUND_LIST);

	pos=userFound->GetCurSel();
	CAddUserDlg addUsr;
	addUsr.m_new_uin=uins[pos];
	addUsr.DoModal();

	CDialog::OnOK();


}

BOOL CUsrFoundDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CListBox* userFound = (CListBox*)GetDlgItem(IDC_FOUND_LIST);

//   char tmp[4];
   int pos;
	for (int i=0; i<num_usr_found;i++) {
	   pos=userFound->InsertString(-1,(Contacts[i]));
	//   userFound->SetItemData(pos,uins[i]);

   }
//	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
	return CDialog::OnInitDialog();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?