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

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

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

DirectInput中的虚拟键(DirectInput Virtual Key)

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

DIK_0 – DIK_9                                                     数字 0 – 9
DIK_A – DIK_Z                                                     字母 A – Z
DIK_F1 – DIK_F12                                                    功能键F1 – F12
DIK_BACK                                                          Backspace 键
DIK_TAB                                                           Tab 键
DIK_RETURN                                                       回车键

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 模式)
1.解压压缩包,打开Demo2/Console.dsw,设置如下:
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 模式),即可,包含方法(点击这里)
注意:生成的LIB文件,比上面要少一个….不知道为什么…少了consoled.lib,但并无大碍,不包含它即可

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

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

Introduction
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.

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

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

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

使用CRectTracker,可以简单的实现操作系统下的选择框
声明与设置

//成员变量
CRectTracker m_RectTracker;

//设置RectTracker样式
m_RectTracker.m_nStyle = CRectTracker::resizeOutside|CRectTracker::solidLine;
m_RectTracker.m_nHandleSize = 6;
m_RectTracker.m_rect.SetRect(0,0,0,0);