作者:Wupei  |  发表时间:  |  所属分类:VC


Winsock函数返回值列表(Return Value of Winsock Function)

作者:Wupei  |  发表时间:  |  所属分类:VC

WSAEINTR (10004)
Interrupted Function Call — A blocking operation was cancelled.
Permission Denied — An attempt to access a socket was forbidden by its access permissions.
Bad Address — An invalid pointer address was specified in a function call.
Invalid Argument — An invalid argument was passed to a function.
Too Many Open Files — There are too many open sockets.

Windows消息中的虚拟键列表(VC Virtual Key)

作者:Wupei  |  发表时间:  |  所属分类:VC

VK_LBUTTON             鼠标左键                       0x01
VK_RBUTTON             鼠标右键                       0x02
VK_CANCEL               Ctrl + Break                   0x03
VK_MBUTTON             鼠标中键                      0x04

VK_BACK                   Backspace 键                 0x08
VK_TAB                    Tab 键                           0x09

VK_RETURN               回车键                          0x0D

Windows常见消息列表(windows familiar message)

作者:Wupei  |  发表时间:  |  所属分类:VC

WM_ACTIVATE                    Indicates a change in the activation state
WM_ACTIVATEAPP               Notifies applications when a new task is activated

WM_CANCELMODE                Notifies a window to cancel internal modes
WM_CHANGECBCHAIN           Notifies clipboard viewer of removal from chain
WM_CHAR                           Passes keyboard events to focus window
WM_CHARTOITEM                Provides list-box keystrokes to owner window
WM_CHILDACTIVATE             Notifies a child window of activation
WM_CLEAR                          Clears an edit control or combo box

使用CxImage (Using MFC by a Static Library + Realese or Debug 模式)

作者:Wupei  |  发表时间:  |  所属分类:VC

一.使用CxImage(Using MFC in a Static Library + Debug 模式)
Project -> Setting -> Using MFC in a Static Library(注意是所有的项目都设置成这个)
2.确保c/c++ -> Code Generation -> Using run-time library 为 Mutithreaded
3.Debug模式下编译,搜索*.lib文件,复制到工程目录,包含进工程(当前工程也必须是Using MFC in a Static Library + Debug 模式),即可,包含方法(点击这里)

使用CxImage进行图形和格式转换(CBitmap to jpg or png or gif or bmp)

作者:Wupei  |  发表时间:  |  所属分类:VC

CxImage is a C++ class to manage almost any kind of images. It can load, save, display, transform images in a very simple and fast way.
Why another image library? Around there are many good libraries (OpenIL, FreeImage, PaintLib …), these are powerful, complete, and constantly updated. However if you ever try to use them, you may find some difficulties; because these libraries are mainly platform independent, written in C, sometimes with a basic C++ wrapper and with tons of compiler switch declarations. Now with the new GDI+ classes on the scene, maybe CxImage isn’t so useful, but at least here you have the source code. It is not a MFC library, altogether it’s a windows library, because of some particular constructors and the painting functions, but the backbone is platform independent.

其他的图形库?有那么多优秀的图形库,如OpenIL,FreeImage,PaintLib等等,它们是功能强大,齐全,而且是经常更新的。然而,如果你要使用他们,你可能会遇到一些麻烦,,因为它们大部分是平台无关的,用C语言写成,有的还夹杂着基本的C++ wrapper和大量的编译选项的声明需要你去处理。现在,一个新的GDI+类库来了,或许CxImage不是最有用的,但是至少你是有源代码的。这个类库不是MFC类库,完全是一个windows类库,因为一些特殊的构造和绘图函数,但是基础是平台无关的。

VC下简易实现窗体的淡入淡出效果(fade in-out for CDialog)

作者:Wupei  |  发表时间:  |  所属分类:VC



VC下使用橡皮筋类(Use CRectTracker)

作者:Wupei  |  发表时间:  |  所属分类:VC