📄 meetingtree.cpp
字号:
// MeetingTree.cpp: implementation of the CMeetingTree class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Demo_airline.h"
#include "MeetingTree.h"
#include "Demo_airlineDlg.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
extern CDemo_airlineApp theApp;
CMeetingTree::CMeetingTree()
{
}
CMeetingTree::~CMeetingTree()
{
}
BOOL CMeetingTree::FillMeetingTree(CTreeCtrl *pTreeCtrl)
{
_RecordsetPtr pRecordMeet;
pRecordMeet.CreateInstance(__uuidof(Recordset));
TVINSERTSTRUCT tvInsert;
tvInsert.hParent = NULL;
tvInsert.hInsertAfter = NULL;
tvInsert.item.mask = TVIF_TEXT;
tvInsert.item.pszText = _T("深航会议");
HTREEITEM hTreeMeet = pTreeCtrl->InsertItem(&tvInsert);
pTreeCtrl->Expand(hTreeMeet, TVE_EXPAND);
try
{
CString strSql;
strSql = "select * from Meeting order by MeetingNo asc";
pRecordMeet->Open(strSql.AllocSysString(),
theApp.m_pConnection.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
pRecordMeet->MoveFirst();
while(!pRecordMeet->adoEOF)
{
_variant_t var = pRecordMeet->GetCollect("MeetingNo");
if(VT_NULL != var.vt)
{
pTreeCtrl->InsertItem((LPCSTR)_bstr_t(var),hTreeMeet,TVI_SORT);
}
else
continue;
pRecordMeet->MoveNext();
}
pRecordMeet->Close();
}
catch(_com_error e)
{
AfxMessageBox(e.ErrorMessage());
}
return TRUE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -