流云の剑舞秋风

吾生也有涯 而知也无涯

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

2005年5月26日 #

摘要: 用VC++修改注册表----让我们踏出第一步(适合初学者)转载自:www.csdn.net 开场白 你是不是非常期待通过自己的双手,写出一个有模有样的"系统修改(维护)工具软件"?我想答案应该是肯定的!而你也许也知道,这些工具所包含的很多功能,其实都是仰赖Windows注册表;通过修改注册表可以实现对系统相关参数的修改.也许这样讲来,你还是觉得不着边际,好,不要急,让我以这篇文章,... 阅读全文
posted @ 2005-05-26 15:43 流云 阅读(2680) 评论(0) 推荐(0) 编辑

2005年5月20日 #

摘要: //stdafx.h#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename("EOF","adoEOF") //主程序初始化函数BOOL CADO2App::InitInstance(){ AfxEnableControlContainer(); AfxOleInit()... 阅读全文
posted @ 2005-05-20 15:25 流云 阅读(6439) 评论(4) 推荐(0) 编辑

2005年5月19日 #

摘要: 在新建对话框上放置2个按钮(隐式和显式调用dll)和1个编辑框(连接变量m_exp),添加按钮响应代码如下(隐式调用时:dll文件要放在对应目录[系统目录或者程序目录]下): void CCalcTestDlg::OnButtonYinshi() { // TODO: Add your control notification handler code here UpdateData... 阅读全文
posted @ 2005-05-19 09:40 流云 阅读(1025) 评论(0) 推荐(0) 编辑

2005年5月18日 #

摘要: 在查询分析器里使用如下代码:sp_Attach_db @dbName = N'a00', @FileName1 = N'D:\vc\sqldb\a00_Data.MDF', @FileName2 = N'D:\vc\sqldb\a00_Log.LDF'把上面的2个文件换成你的对应文件就可以了,按执行--ok或者:在数据库的名字上点右键--所有任务--备分数据库--常规--备分到--(选择存放位置... 阅读全文
posted @ 2005-05-18 22:48 流云 阅读(619) 评论(0) 推荐(0) 编辑

2005年5月17日 #

摘要: 1.新建对话框工程Test,在对话框上放上ListCtrl控件IDC_LIST1,连接变量名m_list,增加代码: BOOL CTestDlg::OnInitDialog(){// m_list.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES); m_list.SetBkColor(RGB(240,255,2... 阅读全文
posted @ 2005-05-17 14:32 流云 阅读(1801) 评论(0) 推荐(0) 编辑

2005年5月16日 #

摘要: 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) 编辑