|
|
Implementing Tooltips for Menus |
![项目详情](images/url_homepage.gif) ![下载](images/url_tgz.gif) ![排行](images/rate.gif) |
简 介:
All the changes to get the menu tip go to CMainFrame class. I first overrode both OnEnterMenuLoop and OnExitMenuLoop, furthermore OnEnterIdle and then FilterToolTipMessage. When a menu pops up, OnEnterMenuLoop is called, which then creates a WS_EX_TOPMOST style tooltip. The tooltip is updated by OnEnterIdle which passes fake WM_MOUSEMOVE messages to the tooltip using RelayEvent. I do need to override FilterToolTipMessage, because the MFC CWnd::FilterToolTipMessage does not create WS_EX_TOPMOST tooltips and therefore does NOT display the tooltip. It is important to define your own method !
生成菜单提示的所有变化都在 CMainFrame 类中完成。我先重载了 OnEnterMenuLoop 和 OnExitMenuLoop,再接着是 OnEnterIdle 和 then FilterToolTipMessage。一个菜单弹出时,调用 OnEnterMenuLoop ,它可以创建一个WS_EX_TOPMOST 风格的工具提示。工具提示由OnEnterIdle 来更新,它使用 RelayEvent传递伪 WM_MOUSEMOVE消息到工具提示中。我需要重载FilterToolTipMessage,因为MFC的CWnd::FilterToolTipMessage 不能创建 WS_EX_TOPMOST 工具提示,因此也不能显示工具提示。这对于定义你自己的方法是很重要的!
来源: http://www.codeguru.com/menu/menutip.html |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
LongScroll |
![项目详情](images/url_homepage.gif) ![下载](images/url_tgz.gif) ![排行](images/rate.gif) |
简 介:
Have you always cursed VB's limit of Integer values for a scrollbar's Value, Min, Max, and *Change properties? Me too. I wrote a class that mapped Long values into these properties for Visual Basic 4 How-To and have now updated it for use with VB5 (or later). The addition of WithEvents allows this to truly be a drop-in class, with no need for the client to notify it on user-interaction. Definitely one you'll want for your toolbox!
你总是抱怨VB中的滚动条的Value, Min, Max, 和 *Change属性只使用Integer 值吗?我也是。我写了一个类,可以将Long 型值映射到这些属性,相关代码已经从Visual Basic 4升级到了VB5(或更高版本)。额外的WithEvents 可以让这个控件真正成为一个可以立即使用的类,不需要客户在用户界面中再通知它。这确实是你在工具箱需要的一个控件!
来源: http://www.mvps.org/vb/ |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
Extending the IE Context Menu in your Ap |
![项目详情](images/url_homepage.gif) ![下载](images/url_tgz.gif) ![排行](images/rate.gif) |
简 介:
Internet Explorer 4.0 uses OLE Activex control and Active Document interfaces to connect components.I will just briefly talk about the Internet Explorer's architecture. Mainly Internet Explorer is just a small application which uses the internet explorer 4.0 components for favourites maintenance,history maintaenance and so on. This executable directly hosts the SHDOCVW.DLL which is nothing but the web browser control. SHDOCVW.DLL in turn hosts the MSHTML.DLL. Implementing the webbrowser control is little bit difficult than implementing the MSHTML.DLL.
Internet Explorer 4.0 使用OLE Activex 控件和Active Document 接口来连接组件。我只是简单地描述了Internet Explorer的体系结构。Internet Explorer主要只是一个小应用程序,它使用internet explorer 4.0 组件来维护收藏、历史信息等等。可执行目录直接包含了SHDOCVW.DLL ,它正是Web浏览器控件。SHDOCVW.DLL 也包含了MSHTML.DLL。实现webbrowser 控件比实现MSHTML.DLL有些难。
来源: http://www.codeguru.com/internet/Contmenu.shtml |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
DateTime with ODBC |
![项目详情](images/url_homepage.gif) ![下载](images/url_tgz.gif) ![排行](images/rate.gif) |
简 介:
Here is my solution for a (little) problem using ODBC and date & time (for VC++ 4.0 & 5.0).
If using ODBC & date/time fields in a typical CRecordView, ClassWizard automatically binds a CTime object to the specific recordset. This object has few limits, but the most important is: there is no way to attach an Edit control in a CRecordView to that field.
With this code, it is possible to bind a date/time field to an Edit control using all MFC utilities, just like string parsing, data validation, data automatic set/get and so on.
DateTime with ODBC
这里是我使用ODBC和Datetime的一 (一点点)个问题的解决方法(为 VC++4.0和5.0)。
如果在典型的CRecordView中使用ODBC和Datetime,ClassWizard会自动地对特定的recordset绑定一个CTime对象。这个对象没有多少限制,但最重要的是: 没有方法将CRecordView中的Edit控件绑定到那个域中。
这段代码,使我们使用所有的MFC公用程序来绑定Datetime到Edit控件成为可能,就像字符串分析,数据核实,数据自动存取等等一样。
来源: http://www.codeguru.com/mfc_database/DateTimeWithODBC.shtml |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
DevStudio style Dockable Menu Bar(does n |
![项目详情](images/url_homepage.gif) ![下载](images/url_tgz.gif) ![排行](images/rate.gif) |
简 介:
I'm looking for Visual C++ 5.0 style menu bar, but most of products require MSIE4 or a new comctrl32.dll(don't encourage me do update) . So I've made a class called CMenuBar which don't use any common controls.
我在寻找 Visual C++ 5.0 风格的菜单条,但大多数产品都需要MSIE4或一个新的 comctrl32.dll(我不能更新)。所以我生成了一个称为 CMenuBar 类,它没有使用任何通用控件。
来源: http://www.codeguru.com/menu/dockmenubar.shtml |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
make your life with ListViews easier |
![项目详情](images/url_homepage.gif) ![下载](images/url_tgz.gif) ![排行](images/rate.gif) |
简 介:
ListViews are controls everyone loves to hate. This demo shows a good number of tricks you can use to make your life with ListViews easier. Sort dates and numbers instead of just text (and at a pace 10-20x faster than the KB method!), reorder the columns, toggle extended styles, use checkboxes on each item, the list goes on.
每个人对ListViews 控件都各有喜好。这个例子演示了许多简化ListView控件处理的技巧。可以按日期和数字排序,而不仅仅按文本排序(比KB方法快了尽10-20倍!),记录了列,扩展的风格,在每个条目中使用复选框,列表可以增长。
来源: http://www.mvps.org/vb/ |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
Creating an Internet Explorer Helper Cla |
![项目详情](images/url_homepage.gif) ![下载](images/url_tgz.gif) ![排行](images/rate.gif) |
简 介:
The purpose of this article is to show how to use IWebBrowser2, IHTMLDocument2, and IHTMLElement objects.
这一文章的目的是演示如何使用IWebBrowser2, IHTMLDocument2, 和IHTMLElement 对象。
来源: http://www.codeguru.com/internet/IEHelper.html |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
Classes for direct SQL calls with ODBC |
![项目详情](images/url_homepage.gif) ![下载](images/url_tgz.gif) ![排行](images/rate.gif) |
简 介:
The main class for doing this is CSQLDirect. CSQLDirect has the following attributes/functions:
CSQLDirect::Connect - Connects to a datasource.
CSQLDirect::ExecuteSQL - this is the main function that is used for handling the SQL statement.
CSQLDirect::GetCol - Will return a column from a table in the resulting cursor.
CSQLDirect::GetError - Provides detailed error messages in case something went wrong.
CSQLDirect::GetColumnType - Provides information about a cursor's column.
CSQLDirect::Fetch - Will properly execute a SQLFetch command with error handling.
CSQLDirect::Close - Closes the connection to the datasource.
The other class CSQLColumn is a support class for CSQLDirect. Since multiple queries to a cursor's column will result in a NULL value being returned, I found it necessary to keep track of the columns as they are used. This is stored in a CPtrArray within CSQLDirect and is cleaned up after each time the cursor is requeried/closed.
通过ODBC直接调用SQL的类
这项工作的主函数是CSQLDirect。CSQLDirect函数具有以下的属性/功能:
CSQLDirect::Connect - 连接数据源
CSQLDirect::ExecuteSQL - t这是处理SQL声明的主要函数
CSQLDirect::GetCol - 返回光标处的一个记录
CSQLDirect::GetError - 当有错误发生时,提供详细的出错信息
CSQLDirect::GetColumnType - 提供一个关于光标所在栏的信息
CSQLDirect::Fetch - 合适的处理一个错误的SQL指令
CSQLDirect::Close - 关闭与数据源的连接
另外了一个类 CSQLColumn支持CSQLDirect类 。 因为对鼠标所在位置的多项查询,容易导致控制的返回。我发现必须跟踪所使用的栏。这个被保存在CSQLDirect中的CPtrArray中,并且在每次光标被调用或关闭时被清空。  
来源: http://www.codeguru.com/mfc_database/direct_sql_with_odbc.shtml |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
MapFile |
![项目详情](images/url_homepage.gif) ![下载](images/url_tgz.gif) ![排行](images/rate.gif) |
简 介:
This one is one of those perpetual works-in-progress, I'm afraid. Shows how to map a file into the memory space of your process, thus allowing extremely rapid access to the bytes within through standard CopyMemory calls.
这是一个不断发展的项目之一。演示了如何将一个文件映射到你的进程所在的内存空间,这样可以及大提高通过标准CopyMemory 函数调用访问内存的速度。
来源: http://www.mvps.org/vb/ |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
|
|
|