|
|
|
|
Embedding an HTML Help window into a dia |
   |
简 介:
CHHCtrl is an MFC class designed for placing an embedded help window inside of a dialog, property sheet, or window. The CHHCtrl class hosts shdocvw directly rather then using the HtmlHelp API. This bypasses the bugs in embedded help introduced with the version of HTML Help released with Visual Studio 6. It also gives you access to all IWebBrowser methods which means you can change HTML files on the fly -- for example, showing the actual key associations currently in effect for a program rather then the default set it ships with.
CHHCtrl 是一个MFC类,设计为在对话框中增加一个内嵌的帮助对话框、属性页或窗口。CHHCtrl 类直接包含了 shdocvw ,而没有使用HtmlHelp API。这种方法绕过了Visual Studio 6中提供的 HTML Help中的错误。它也可以让你访问所有 IWebBrowser 方法,这样你可以方便地修改HTML文件。例如,显示目前程序中实际的关联,而不是它封装的缺省设置。
来源: https://www.codeguru.com/dialog/html_help.shtml |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
Smart Pointer that supports subclassing |
   |
简 介:
Until now all smart pointer implementations that I have seen didn't support assignment between base and derived class pointers. Here is an implementation that does support it. I give you two implementations of smart pointers:
1) Ptr - This smart pointer assumes that 'T' support reference counting by deriving from IRefCount (which is also supplied).
2) SmartPtr - This smart pointer is more generic than Ptr while not assuming anything about the type 'T'. Being more generic costs having a small reference object created for each referenced object or type.
直到目前我所见到过的所有的智能指针不支持基类和派生类指针间的赋值。这里是支持这一功能的实现。我给出了智能指针的两个实现:
1) Ptr -这个智能指针假设通过派生自IRefCount 来支持引用计数。
2) SmartPtr - 这个智能指针比Ptr 更通用,没有对 'T'进行任何假设。为了支持更多的通用性,只能让每个引用对象或类型创建更少的引用对象。
来源: https://www.codeguru.com/cpp_mfc/smartPtrEfrati.shtml |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
The Count Game |
   |
简 介:
This is a JavaScript counter based game. To play the game, click on the button to the left. The counter will start. Click on the button again to stop the counter.
这是一个基于 JavaScript 计数器的游戏。要运行这个游戏,点击左边的按钮,计数器将开始。再点击一次这个按钮,将停止计数器。
来源: https://java.ittoolbox.com/code/d.asp?d=1932&a=s |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
C# SNTP Client |
   |
简 介:
C# class for implementing time synchronization into your application
这个项目演示了一个C#类,用于在你的应用程序中实现时间同步操作。
来源: https://www.codeguru.com/cs_date_time/NTPClient.html |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
Standard file open dialog with preview |
   |
简 介:
The template for the dialog is a normal developer studio dialog template. Note however, the use of the stc32 static control. As it hasn't any text in it, it is invisible unless you select it. This static control will serve as a place holder for the standard file dialog controls, thus establishing the position of the newly added controls in respect to the standards. If there is no stc32 control specified in the template, all the new controls will be placed below the standard controls.
这是一个带有预览功能的标准文件打开对话框。对话框模板是一个普通的 developer studio 对话框模板。然而,它使用了stc32 static 控件。因为其上没有任何文本,除非你选择它,否则它是不可见的。这个 static 控件将作为标准文件对话框的一个占位控件,这样为新增加的控件预留了位置。如果在模板中没有stc32 控件,所有新增加的控件将位于标准控件的下面。
来源: https://www.codeguru.com/dialog/bitmap_preview_dialog.shtml |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
A Smart Pointer Class for Subclass Point |
   |
简 介:
The SmartPtr class by Stefan Tchekanov works nicely for homogenous class objects but it does not allow assignment between base and derived class pointers. I am presenting here a simple template class that performs reference counting garbage collection and supports subclass pointers.
由 Stefan Tchekanov 提供的SmartPtr 类可以很好地用于同构类对象,但它不支持基类和派生类指针间的赋值。我在这里提供一个简单的模板类,它执行引用计数垃圾回收功能,支持子类指针。
来源: https://www.codeguru.com/cpp_mfc/pointer.shtml |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
Fading Ticker for IE |
   |
简 介:
This JavaScript is a Fading Ticker for IE
这个 JavaScript 是为IE提供的一个渐变的Ticker。
来源: https://java.ittoolbox.com/code/d.asp?d=1951&a=s |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
Simple ADO Database Read, Insert, Update |
   |
简 介:
Accessing databases is a common part of most applications and with the introduction of C# and ADO.NET, has become quite simple. This article will demonstrate the four most basic database operations.
访问数据库是大多数应用程序的常用操作,使用 C# and ADO.NET,这一操作会变得很简单。这个项目演示了四种最基本的数据库操作。
来源: https://www.codeguru.com/cs_data/SimpleDbReadWrite.html |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
Transparent Dialog |
   |
简 介:
Ok. Every window has a Region. This is how Windows knows what area of the screen to draw on when something changes in your program. Normally a windows Region is square, but you can make one that is non-square (basically any shape you want) so that Windows will only draw the part of your window that is within the non-square Region. What I have done is scan through the window pixel by pixel looking for the color I want to make transparent. Everytime I find that color, I add it to a temporary Region. I collect all the transparent spaces, then invert it and assign it to the window. The CRgn class, as it turns out, it a very powerful little class.
每个窗口都有一个区域。这就是Windows知道当应用程序变化时应该在屏幕的什么地方绘制窗口。通常一个Windows区域是矩形的,但可以生成非矩形窗口(基本上可以是任意窗口),这样Windows将只绘制非矩形区域中的一部分。我所希望的是按像素扫描窗口以查找需要设置为透明的颜色。一旦找到这一颜色,我将相应的像素增加到一个临时区域中。我收集所有的透明区域,反转它,并将它分配给窗口。CRgn 是一个功能强大的类。
来源: https://www.codeguru.com/dialog/transparent_dialog.shtml |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
Function Pointers to Non-Static Object M |
   |
简 介:
The code I have included is a holder class that takes a pointer to an object and a pointer to a method.   Either can be changed at any time. During the lifetime of the holder class object, a helper method can be called that calls the stored method pointer.  
我在这里提供的是一个容器类,它接收一个指向对象的指针和一个指向一个方法的指针。可以随意改变任何一个参数。在窗口对象的生命期内,可以调用一个helper 方法来调用保存的方法指针。
来源: https://www.codeguru.com/cpp_mfc/methodpointers.shtml |
分 类:
|
许可证:
GNU General Public License (GPL) |
|
|
|
|
|