再一本图像书里看到的,不懂

amartapple 2002-11-10 07:04:15
今天在一本书中看到了如下代码,有这么些地方不明白,希望大家能给解释一下,谢谢

1。底下这个里面的 LPDWORD 应该是个数据类型吧,但它是什么类型呢,c++里没有呀,BITMAPINFOHEADER又是什么东西?
// 判断是否是Win 3.0的DIB
#define IS_WIN30_DIB(lpbi) ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER))

2。BYTE WORD 是什么类型,C++也没有
typedef struct{
BYTE bManufacturer;
BYTE bVersion;
BYTE bEncoding;
BYTE bBpp;
WORD wLeft;
WORD wTop;



} HEADER;

3。看看下面的函数,LPSTR DWORD WORD HGLOBAL LPSTR 都不知道是什么数据类型,还有后面的 WINAPI 加在这里干什么
// 函数原型
BOOL WINAPI PaintDIB (HDC, LPRECT, HDIB, LPRECT, CPalette* pPal);
BOOL WINAPI CreateDIBPalette(HDIB hDIB, CPalette* cPal);
LPSTR WINAPI FindDIBBits (LPSTR lpbi);
DWORD WINAPI DIBWidth (LPSTR lpDIB);
DWORD WINAPI DIBHeight (LPSTR lpDIB);
WORD WINAPI PaletteSize (LPSTR lpbi);
WORD WINAPI DIBNumColors (LPSTR lpbi);
WORD WINAPI DIBBitCount(LPSTR lpbi);
HGLOBAL WINAPI CopyHandle (HGLOBAL h);
...全文
36 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
qrlvls 2002-11-10
  • 打赏
  • 举报
回复
LPDWORD = DWORD* = unsigned long *
BYTE = unsigned char
WORD = unsigned short

BITMAPINFOHEADER是位图文件头结构,在VC里面有

你到MSDN里面查一下全都知道了
cbc 2002-11-10
  • 打赏
  • 举报
回复
LPDWORD Pointer to a DWORD.
BITMAPINFOHEADER是位图文件头结构,详见
http://www.csdn.net/Develop/Read_Article.asp?Id=12484

至于你后面的问题MSDN上都有,自己多看看MSDN就不会有这么多问题了
llwwwww 2002-11-10
  • 打赏
  • 举报
回复
以下摘自MSDN

Data Types
This topic lists the data types most commonly used in the Microsoft Foundation Class Library. Most of the data types are exactly the same as those in the Windows Software Development Kit (SDK), while others are unique to MFC.

Commonly used Windows SDK and MFC data types are as follows:

BOOL A Boolean value.


BSTR A 32-bit character pointer.


BYTE An 8-bit integer that is not signed.


COLORREF A 32-bit value used as a color value.


DWORD A 32-bit unsigned integer or the address of a segment and its associated offset.


LONG A 32-bit signed integer.


LPARAM A 32-bit value passed as a parameter to a window procedure or callback function.


LPCSTR A 32-bit pointer to a constant character string.


LPSTR A 32-bit pointer to a character string.


LPCTSTR A 32-bit pointer to a constant character string that is portable for Unicode and DBCS.


LPTSTR A 32-bit pointer to a character string that is portable for Unicode and DBCS.


LPVOID A 32-bit pointer to an unspecified type.


LRESULT A 32-bit value returned from a window procedure or callback function.


UINT A 16-bit unsigned integer on Windows versions 3.0 and 3.1; a 32-bit unsigned integer on Win32.


WNDPROC A 32-bit pointer to a window procedure.


WORD A 16-bit unsigned integer.


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.
Data types unique to the Microsoft Foundation Class Library include the following:

POSITION A value used to denote the position of an element in a collection; used by MFC collection classes.


LPCRECT A 32-bit pointer to a constant (nonmodifiable) RECT structure.
llwwwww 2002-11-10
  • 打赏
  • 举报
回复
是啊,这是最基本的东西,每人都问一下很烦的!
phoenix96_2000 2002-11-10
  • 打赏
  • 举报
回复
在这些词上右键:转到定义,就可以看到是什么了
不过这些都是windows编程的基本东西,你还是看一看一些基础点的WINDOWS入门书籍,
上面的那位兄弟,F1是没法找到LPSTR的哟,呵呵
maskii 2002-11-10
  • 打赏
  • 举报
回复
这些类型自己查好了,每次问人家怎么行?你装了msdn了吗?
你只要在程序中写上LPSTR(以这个为例),然后F1不就得了。
像这个查出来就是以\0结束的8位的串。
amartapple 2002-11-10
  • 打赏
  • 举报
回复
up
amartapple 2002-11-10
  • 打赏
  • 举报
回复
不好意思
我不是用vc的,只不过现在要移植一个工程,呵呵

19,468

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 图形处理/算法
社区管理员
  • 图形处理/算法社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧