摘要: void CMFCTreeDlg::InitTreeCtrl(){ //设置控件的图标列表 m_ilNormal.Create(IDB_NORMAL,16,1,RGB(0,0,0));m_wndTree.SetImageList(&m_ilNormal,TVSIL_NORMAL);/*//添加测试数据HTREEITEM hRoot=m_wndTree.InsertItem("北京市",0,2);HTREEITEM hCY=m_wndTree.InsertItem("朝阳区",1,3,hRoot);HTREEITEM hHD=m_wndTree.I 阅读全文
posted @ 2012-12-18 14:07 中国男孩 阅读(192) 评论(0) 推荐(0) 编辑
摘要: void CDlgBaseControlDlg::OnOpenfile() {// TODO: Add your control notification handler code herechar szFilter[]="视频文件(*.avi)|*.avi|所有文件(*.*)|*.*||";CFileDialog dlg(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,szFilter);if (IDOK!=dlg.DoModal()){return;} //显示文件路径m_strFilePath=dlg.Get 阅读全文
posted @ 2012-12-18 13:59 中国男孩 阅读(235) 评论(0) 推荐(0) 编辑
摘要: #include "resource.h"class CMyDlg:public CDialog{public:CMyDlg();virtual BOOL OnInitDialog( );virtual void DoDataExchange(CDataExchange* pDX );virtual void OnOK();public:CWnd m_wndOK;//和OK按钮绑定CString m_strData;//和编辑框控件绑定的值变量};CMyDlg::CMyDlg():CDialog(IDD_DIALOG1){}void CMyDlg::DoDataExchan 阅读全文
posted @ 2012-12-18 13:46 中国男孩 阅读(198) 评论(0) 推荐(0) 编辑
摘要: CWinApp theApp;using namespace std;//文件操作void CFileExample(){ CFile file; //打开或者新建文件 BOOL bRet=file.Open("c:\\mfcfile.txt", CFile::modeCreate|CFile::modeReadWrite); if (!bRet)return; //文件的读写操作 try { file.Write("Hello CFile",11); //移动文件指针到文件的开始位置 file.SeekToBegin(); char szText[10 阅读全文
posted @ 2012-12-18 13:38 中国男孩 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 画图使用void CMFCDCView::OnDrawCdc() {// TODO: Add your command handler code hereCDC dc;dc.CreateDC("DISPLAY",NULL,NULL,NULL);dc.TextOut(50,50,"Hello CDC");dc.DeleteDC();}void CMFCDCView::OnDrawWindowdc() {// TODO: Add your command handler code hereCWindowDC dc(AfxGetMainWnd());dc.Te 阅读全文
posted @ 2012-12-18 13:35 中国男孩 阅读(302) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2012-12-18 13:31 中国男孩 阅读(8) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2012-12-18 13:27 中国男孩 阅读(5) 评论(0) 推荐(0) 编辑