您的位置:首页 > 其它

MFC常用数据类型介绍

2011-03-03 19:37 357 查看
MFC常用数据类型:

1、
UINT A 16-bit unsigned integer on Windows versions 3.0 and 3.1; a 32-bit unsigned integer on Win32.
定义原型:
typedef unsigned int UINT;

2、
bool应该是C语言里定义的,返回值为true和false(事实上就上1和0)

BOOL应该是MFC及SDK里定义返回值的.
它的定义应该是:typedef int BOOL;(WINDEF.H中定义)
也就是说它是int型的
返回值是大写的TRUE 和FALSE
定义如下:
#define FALSE 0
#define TRUE 1
(AFX.H中如此定义)

3、
BSTR A 32-bit character pointer 32位的字符指针。
定义原型:
#if defined(WIN32) && !defined(OLE2ANSI)
typedef WCHAR OLECHAR;
#else
typedef char OLECHAR;
#endif
typedef OLECHAR* BSTR;

4、
BYTE An 8-bit integer that is not signed.无符号8位整数。注意整数和整型int不一样。
定义原型:
typedef unsigned char BYTE;

5、
COLORREF A 32-bit value used as a color value.
定义原型:
typedef DWORD COLORREF;

6、
DWORD A 32-bit unsigned integer or the address of a segment and its associated offset.
定义原型:
typedef unsigned long DWORD;

7、
LONG A 32-bit signed integer.
定义原型:
typedef long LONG;

8、
LPARAM A 32-bit value passed as a parameter to a window procedure or callback function.
定义原型:
typedef LONG LPARAM;

9、
LPCSTR A 32-bit pointer to a constant character string
定义原型:
typedef CONST CHAR *LPCSTR, *PCSTR;

10、
LPSTR A 32-bit pointer to a character string.
定义原型:
typedef CHAR *LPSTR, *PSTR;

11、
LPCTSTR A 32-bit pointer to a constant character string that is portable for Unicode and DBCS.
定义原型:
typedef LPCSTR LPCTSTR;

12、
LPTSTR A 32-bit pointer to a character string that is portable for Unicode and DBCS.
定义原型:
typedef LPSTR PTSTR, LPTSTR;

13、
LPVOID A 32-bit pointer to an unspecified type.
定义原型:
typedef void far *LPVOID;

14、
LRESULT A 32-bit value returned from a window procedure or callback function.
定义原型:
typedef LONG LRESULT;

15、
WNDPROC A 32-bit pointer to a window procedure.
定义原型:
typedef LRESULT (CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);

16、
WORD A 16-bit unsigned integer.
定义原型:
typedef unsigned short WORD;

17、
WPARAM A value passed as a parameter to a window procedure or callback function: 16 bits on Windows versions 3.0 and 3.1; 32 bits on Win32.
定义原型:
typedef UINT WPARAM;

18、
POSITION A value used to denote the position of an element in a collection; used by MFC collection classes.
定义原型:
// abstract iteration position
struct __POSITION { };
typedef __POSITION* POSITION;

19、
LPCRECT A 32-bit pointer to a constant (nonmodifiable) RECT structure.
定义原型:
typedef const RECT* LPCRECT; // pointer to read/only RECT
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: