随笔分类 -  MFC

摘要:转载自:http://www.zxbc.cn/html/20080418/33430.html  PreTranslateMessage是消息在送给TranslateMessage函数之前被调用的,绝大多数本窗口的消息都要通过这里,比较常用,当需要在MFC之前处理某些消息时,常常要在这里添加代码. MFC 消息控制流最具特色的地方是CWnd类的虚拟函数PreTranslateMessage(),通... 阅读全文
posted @ 2010-01-06 15:55 能巴 阅读(740) 评论(0) 推荐(0)
摘要:AfxGetResourceHandle It returns An HINSTANCE handle where the default resources of the application are loaded. AfxSetResourceHandle Use this function to set the HINSTANCE handle that determines where ... 阅读全文
posted @ 2009-07-05 12:29 能巴 阅读(1474) 评论(0) 推荐(0)
摘要:For AfxLoadLibrary, and serving as the dll search rule: When no path is specified, the function searches for the file in the following sequence: The directory from which the application loaded. The c... 阅读全文
posted @ 2009-07-05 11:45 能巴 阅读(1072) 评论(0) 推荐(0)
摘要:It's so clear that there are three type dlls: regular dll, extension dll and non-MFC dll on windows. Below table from MSDN shows how to initialize it:Typically, your DLL has initialization code (such ... 阅读全文
posted @ 2009-07-05 11:18 能巴 阅读(316) 评论(0) 推荐(0)
摘要:[From CodeGuru: http://www.codeguru.com/cpp/w-d/dislog/ddxddv/article.php/c1997/]Enhacing CDialogBar with InitDialog and DDX Rating: Alger Pike (view profile) August 7, 1998 As you all know, the CDi... 阅读全文
posted @ 2009-05-30 00:35 能巴 阅读(674) 评论(0) 推荐(0)
摘要:[转载自: http://blog.csdn.net/franksunny/archive/2006/01/06/572357.aspx]一、创建DialogBar的派生类 首先,创建对话框资源:在对话框资源编辑器内生成一个Dialog资源,并将其风格(Style)属性必须设置为Child,不能设置为 Overlapped或Popup,否则运行肯定出错;至于边界属性必须选择None。其余属性也随用... 阅读全文
posted @ 2009-05-30 00:32 能巴 阅读(7272) 评论(0) 推荐(1)
摘要:[转自:http://blog.csdn.net/gxj1680/archive/2009/03/17/3998923.aspx]窗口消息概述: 所有的窗口消息的基本形式都是一样的,有3个部分:(1).一个无符号整数,包含消息的实际内容.(2)WPARAM,一个4字节整数.(3)LPARAM,一个4字节参数.无符号数是实际消息. 含MFC在内的任何WINDOWS程序的核心都是消息泵.消息泵是一个循... 阅读全文
posted @ 2009-05-28 14:20 能巴 阅读(1456) 评论(1) 推荐(0)
摘要:Model Dialog in Win32 c++ Creating modeldialog is veryeasy in MFC.It has neat class for dialog , CDialog. The DoModel functions of CDialog provides a way to appear model dialog. In Win32 thisis anoth... 阅读全文
posted @ 2009-05-28 13:17 能巴 阅读(1069) 评论(0) 推荐(0)
摘要:In the place you plan to post message:a. If you are sure the WM_Command can be handled by view/document, you can directly call View::OnCmdMsg() or Doc::OnCmdMsg() to post the message;b. If you don't k... 阅读全文
posted @ 2009-05-21 13:33 能巴 阅读(1251) 评论(0) 推荐(0)
摘要:1. 菜单是Windows的标准界面元素,几乎所有的Windows应用程序中都有它的身影。MFC中的类CMenu对它进行了封装,使其使用起来更加简便。 要在程序中使用菜单也很简单,一般分以下几步:第一步先用VC的菜单编辑器创建一个菜单资源,给它赋予我们自己定义的ID,第二步在程序中构造一个 CMenu类的对象,用CMenu::LoadMenu函数将菜单从资源中装入,接着调用CWnd::SetMen... 阅读全文
posted @ 2009-05-11 23:01 能巴 阅读(375) 评论(0) 推荐(0)
摘要:关于MVC结构模式无须多言,如下图所示: 在MFC中实现经典的MVC结构,如下图所示:注意:1、Document和View之间的绑定:View绑定到Document。2、Frame作为Controller时,由于可以接收到输入消息,比较适合充当控制器。但是,由于视图和文档绑定,所以在切换视图时需要将视图和文档分离开,然后再进行切换。3、View作为Contrller时,由于该视图和文档是绑定的,... 阅读全文
posted @ 2009-05-10 23:55 能巴 阅读(1442) 评论(0) 推荐(0)
摘要:[MSDN:http://msdn.microsoft.com/en-us/library/xwz5tb1x(VS.80).aspx]Dialog Data Exchange If you use the DDX mechanism, you set the initial values of the dialog object's member variables, typically in y... 阅读全文
posted @ 2009-05-10 20:34 能巴 阅读(484) 评论(0) 推荐(0)
摘要:1. Dll typesThree:Win32 dllMFC regular dllMFC extension dll2. MFC extension dllBasic[MSDN]:An MFC extension DLL is a DLL that typically implements reusable classes derived from the existing Microsoft ... 阅读全文
posted @ 2009-05-10 18:35 能巴 阅读(1777) 评论(0) 推荐(0)
摘要:[MSDN: http://msdn.microsoft.com/en-us/library/6t3612sk(VS.71).aspx]TN035: Using Multiple Resource Files and Header Files with Visual C++ NoteThe following technical note has not been updated since it... 阅读全文
posted @ 2009-05-08 23:43 能巴 阅读(890) 评论(0) 推荐(0)
摘要:[转载自:http://www.mscto.com/cppvc/1541912.html] MFC-对话框与数据交换 对话框是非常重要的一种窗体,就我看过的应用,除了MDI程序,对话框比文档视图框架用得更多。原因大概有两个,首先对话框可以利用资源编辑器来编 辑,这就有了一点快速开发的感觉,尽管比真正的快速开发弱得多;其次,对话框提供一种叫数据交换的方法,让控件与某种数据类型关联起来,比如... 阅读全文
posted @ 2009-04-22 00:17 能巴 阅读(1900) 评论(1) 推荐(1)
摘要:MSDN MFC: http://msdn.microsoft.com/zh-cn/library/d06h2x6e.aspxTN020 http://msdn.microsoft.com/zh-cn/library/ft1t4bbc.aspxNeed to learn0. 什么是窗口类?窗口函数?IRR的使用00. Articles:http://www.vckbase.com/document... 阅读全文
posted @ 2009-04-16 16:04 能巴 阅读(389) 评论(0) 推荐(0)
摘要:MFC Library Reference [MSDN: http://msdn.microsoft.com/zh-cn/library/0asx94f7(VS.80).aspx] Managing the State Data of MFC Modules This article discusses the state data of MFC modules and how thi... 阅读全文
posted @ 2009-04-14 22:55 能巴 阅读(297) 评论(0) 推荐(0)
摘要:对于Windows平台而言,dll一共有4种类型: 非 MFC DLL 静态链接到 MFC 的规则 DLL (MFC Regular DLL) 动态链接到 MFC 的规则 DLL(MFC Regular DLL) 扩展 DLL(MFC Extension DLL) ... 阅读全文
posted @ 2009-04-13 22:58 能巴 阅读(838) 评论(0) 推荐(0)
摘要:1. 资源Basic Visual C++ 支持十种资源:加速键、位图、光标、对话框、HTML、图标、菜单、串表、工具条和版本信息。 各种资源就是堆数据而已,最终都会被嵌入到EXE文件里的数据区中。需要的时候就通过函数加载到内存中使用。和数据库一样的。各种资源通过ID来唯一确 定,就像数据库用关键字来确定一样。不同的资源由于类型不一样可以使用等值的ID,如同数据库里的每一个表... 阅读全文
posted @ 2009-04-13 22:28 能巴 阅读(1723) 评论(0) 推荐(0)
摘要:CString::LoadString(UINT nID) Conclusion: the correct way to load string resource by ID is to call CString::LoadString(HINSTANCE hInstance,UINT nID), specifying the dll handler you want to search for.... 阅读全文
posted @ 2009-04-07 22:08 能巴 阅读(379) 评论(0) 推荐(0)