DlgAll.cpp
上传用户:jzscgs158
上传日期:2022-05-25
资源大小:8709k
文件大小:2k
- // DlgAll.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ncshop.h"
- #include "DlgAll.h"
- #include "ADOConn.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CDlgAll dialog
- CDlgAll::CDlgAll(CWnd* pParent /*=NULL*/)
- : CDialog(CDlgAll::IDD, pParent)
- {
- //{{AFX_DATA_INIT(CDlgAll)
- // NOTE: the ClassWizard will add member initialization here
- strTitle="";
- strSql="";
- intOpen=0;
- intKey=0;
- //}}AFX_DATA_INIT
- }
- void CDlgAll::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CDlgAll)
- DDX_Control(pDX, IDC_LIST1, m_listMain);
- //}}AFX_DATA_MAP
- }
- BEGIN_MESSAGE_MAP(CDlgAll, CDialog)
- //{{AFX_MSG_MAP(CDlgAll)
- ON_NOTIFY(NM_DBLCLK, IDC_LIST1, OnDblclkList1)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CDlgAll message handlers
- BOOL CDlgAll::OnInitDialog()
- {
- CDialog::OnInitDialog();
- // TODO: Add extra initialization here
- CADOConn adoMain;
- GetDlgItem(IDC_STATIC1)->SetFont(&ftHeader);
- GetDlgItem(IDC_STATIC1)->SetWindowText(strTitle);
- adoMain.Open(strSql);
- adoMain.InitList(&m_listMain,intOpen);
- adoMain.FillList(&m_listMain,intOpen);
- adoMain.ExitConnect();
- return TRUE; // return TRUE unless you set the focus to a control
- // EXCEPTION: OCX Property Pages should return FALSE
- }
- void CDlgAll::OnDblclkList1(NMHDR* pNMHDR, LRESULT* pResult)
- {
- // TODO: Add your control notification handler code here
- POSITION pos;
- int i;
- pos=m_listMain.GetFirstSelectedItemPosition();
- i=m_listMain.GetNextSelectedItem(pos);
- if (i>=0)
- {
- intSelect=i;
- strKey=m_listMain.GetItemText(i,intKey);
- CDialog::OnOK();
- }
- *pResult = 0;
- }