流云の剑舞秋风

吾生也有涯 而知也无涯

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

2005年5月15日 #

摘要: 1.新建2个对话框IDD_DIALOG1和IDD_DIALOG2,在上面随便放点什么控件之类的;用向导为它们添加类CPage1和CPage2,基类都是CPropertyPage.2.用向导添加新类CProSheet,基类为CPropertySheet,在ProSheet.h中加入 // ProSheet.h : header file#include "Page1.h"#include "Pa... 阅读全文
posted @ 2005-05-15 13:16 流云 阅读(536) 评论(0) 推荐(0) 编辑

摘要: #define APPKEY "Software\\Microsoft\\test"#define USERNAME "UserName"#define USERAGE "UserAge"#define MAXNAMELENGTH 20//写注册表 HKEY hkey; DWORD dwAction; CString m_name="XXXX1111"; DWORD m_age=0x00000... 阅读全文
posted @ 2005-05-15 12:00 流云 阅读(441) 评论(0) 推荐(0) 编辑

摘要: 新建对话框IDD_DIALOG1,用ClassWizzard创建此对话框的类CDlg,基类为CDialog,在你要使用这个对话框的地方,假设你在CDIALOGDlg::OnButton1()调用它,就在DIALOGDlg.h里加入#include "Dlg.h", 然后在DIALOGDlg类里的public:处加入:CDlg dlg;现在你就可以在CDIALOGDlg::OnButton1()调用... 阅读全文
posted @ 2005-05-15 09:55 流云 阅读(354) 评论(0) 推荐(0) 编辑

2005年5月14日 #

摘要: GetDlgItem(控件ID)->ShowWindow(SW_HIDE); //隐藏GetDlgItem(控件ID)->ShowWindow(SW_SHOW); //恢复显示 阅读全文
posted @ 2005-05-14 15:55 流云 阅读(432) 评论(0) 推荐(0) 编辑

2005年5月13日 #

摘要: #include #include voidmain() { charSourceName[81]; charDestinName[81]; cout>SourceName; cout>DestinName; try { CFilefileSource(SourceName,CFile::modeRead); ... 阅读全文
posted @ 2005-05-13 19:56 流云 阅读(1562) 评论(1) 推荐(0) 编辑

摘要: //读写2进制流文件 #include #include #include voidmain() { ofstreamf1("wr1.dat"); if(!f1) { cerr>x) cout<<x<<''; cout<<endl; f2.close(); } 阅读全文
posted @ 2005-05-13 19:54 流云 阅读(581) 评论(0) 推荐(0) 编辑

2005年5月12日 #

摘要: c++中创建动态二维数组的程序代码 动态创建一维数组 int*arr;//itcanbeanyothertype(char,float) arr=newint[n];//nshouldbeintegervariable 动态创建二维数组 int**arr; intN,M; cin>>N>>M; arr=newint*... 阅读全文
posted @ 2005-05-12 16:17 流云 阅读(1236) 评论(0) 推荐(0) 编辑

摘要: 新建一个SDI的工程,所有都是默认.打开资源编辑器,右键,import选择图片导入.使用默认的ID 不要尝试去编辑他,因为他的颜色超过了256.在OnDraw函数中添加如下代码: CDCmemDC;//内存设备场景 CBitmapcb;//位图类对象 CRectrect; GetWindowRect(&rect); cb.LoadBitmap(IDB_BITMAP1);... 阅读全文
posted @ 2005-05-12 14:54 流云 阅读(443) 评论(0) 推荐(0) 编辑

摘要: CStringstrPath; GetCurrentDirectory(MAX_PATH,strPath.GetBuffer(MAX_PATH)); strPath.ReleaseBuffer(); returnstrPath; 阅读全文
posted @ 2005-05-12 14:48 流云 阅读(440) 评论(0) 推荐(0) 编辑

摘要: #include #include #include voidmain() { srand((unsigned)time(NULL));//以系统时间作种子,就不会每次都产生一样的序列了 doubletemp=double(rand()%4000+3000)/10000.0;//调节精度 temp=temp<0.5?(temp-0.2):(... 阅读全文
posted @ 2005-05-12 09:42 流云 阅读(528) 评论(0) 推荐(0) 编辑