流云の剑舞秋风

吾生也有涯 而知也无涯

博客园 首页 新随笔 联系 订阅 管理

2005年5月16日 #

摘要: 在VC中使用ADO开发数据库应用程序(1) 1.引入ADO库文件 使用ADO前必须在工程的stdafx.h文件里用直接引入符号#import引入ADO库文件,以使编译器能正确编译。代码如下所示: #import "c:\program files\common files\system\ado\msado15.dll" no—namespaces rename("EOF" adoE... 阅读全文
posted @ 2005-05-16 21:50 流云 阅读(400) 评论(0) 推荐(0) 编辑

摘要: char *pFileName="test.txt"; CStdioFile sf; if(!sf.Open(pFileName,CFile::modeCreate|CFile::modeReadWrite|CFile::typeText)) {#ifdef _DEBUG afxDump<<"Unable to open file"<<"\n";#endif ... 阅读全文
posted @ 2005-05-16 15:03 流云 阅读(1183) 评论(1) 推荐(0) 编辑

摘要: //打开文件(modeCreate:文件不存在就创建文件,若存在而无modeNoTruncate标志则清空文件)CFile file("text.txt",CFile::modeReadWrite|CFile::modeNoTruncate|CFile::modeCreate); char pbuf[100]; UINT nBytesRead=file.Read(pbuf,100); //Af... 阅读全文
posted @ 2005-05-16 14:20 流云 阅读(1159) 评论(0) 推荐(0) 编辑

摘要: CFontDialog fdlg; if(fdlg.DoModal()==IDOK) { LOGFONT lf; CFont *ft; ft=new CFont; fdlg.GetCurrentFont(&lf); ft->CreateFontIndirect(&lf); this->m_font.SetFont(ft,TRUE); //m_font是编辑框连接的control变... 阅读全文
posted @ 2005-05-16 13:23 流云 阅读(1015) 评论(0) 推荐(0) 编辑

摘要: CColorDialog cdlg; char *r,*g,*b; r=new char; g=new char; b=new char; CString str; if(cdlg.DoModal()==IDOK) { COLORREF cSel=cdlg.GetColor(); itoa(GetRValue(cSel),r,sizeof(r)); itoa(GetGValue(cSel),... 阅读全文
posted @ 2005-05-16 12:49 流云 阅读(683) 评论(0) 推荐(0) 编辑

摘要: CString str; //获取系统时间 CTime tm; tm=CTime::GetCurrentTime(); str=tm.Format("现在时间是%Y年%m月%d日 %X"); MessageBox(str,NULL,MB_OK);//获取程序运行时间 long t1=GetTickCount();//程序段开始前取得系统运行时间(ms) Sleep(500); long t2... 阅读全文
posted @ 2005-05-16 11:02 流云 阅读(995) 评论(0) 推荐(0) 编辑