毕设日记(一)

来源:互联网 发布:美国债券市场数据 编辑:程序博客网 时间:2024/04/29 18:09

 本来早就发布在了windows live space里,可是又觉得这样对不起csdn的blog,还是把它们都贴过来的吧。虽然有点肤浅,都是最基本的常识,不过虽然我是菜鸟呢,唉

毕业设计开始一段时间了。经过了前一阶段的需求分析和设计,终于开始编码,然而……好久不写,生疏掉了,于是赶紧把遇到的问题写下来,以防以后忘掉。
1、OnCreate/OnSize/OnInitDialog哪个先执行?
    下面是从MSDN上选的:
    OnCreate:The framework calls this member function when an application requests that the windows windows be created by calling the Create or CreateEx member function. The CWnd object receives this member function to perform any needed initialization before it becomes visible.
 
    OnSize: The framework calls this member function after the window's size has changed.
 
    OnInitDialog:This member function is called in response to the WM_INITDIALOG message. This message is sent to the dialog box during the Create, CreateIndirect, or DoModal calls, which occur immediately before the dialog box is displayed.
 
     从MSDN的解释来看,OnCreate应该是在OnInitDialog之前被调用的。但是和OnSize的顺序还是看不太明显。于是……哈哈,我们有MessageBox
     测试的结果是 OnCreate > OnSize > OnInitDialog
     看到的也可以去试试,万一我说错,赶紧告诉我。
 
2、Windows Mobile中字符串必须是Unicode
    在开发MFC智能设备应用程序时,百事不爽的MessageBox("Hello world!")竟然不给面子,出错了。于是……_T("Hello World!"),看来_T()这个东西还是很好很强大的。同样的,在下面的结构里也得_T一把
    CString str;
    str.Format(_T("%d"), a);
原创粉丝点击