各位仁兄,想问问关于loadbitmap的问题

popkiler 2003-09-16 05:44:29
HBITMAP hbmCheck = LoadBitmap((HINSTANCE) NULL,(LPTSTR)OBM_CHECK);
HBITMAP hbmRadio = LoadBitmap((HINSTANCE) NULL,(LPTSTR)OBM_BTNCORNERS);

想问问为什么我假如这句时,为什么会出错阿?

E:\RECYCLER\RECECLY\复件 MYQQ___完美版\注释过的完全成功的作品\rcm.cpp(474) : error C2065: 'OBM_CHECK' : undeclared identifier
E:\RECYCLER\RECECLY\复件 MYQQ___完美版\注释过的完全成功的作品\rcm.cpp(475) : error C2065: 'OBM_BTNCORNERS' : undeclared identifier

我知道这必须头文件是:#include <Winuser.h>,#include <Windows.h>
lib文件是:User32.lib
可是还是出错阿

...全文
180 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
popkiler 2003-09-18
  • 打赏
  • 举报
回复
Loads a predefined bitmap used by Windows.

BOOL LoadOEMBitmap(
UINT nIDBitmap
);
Parameters
nIDBitmap
ID number of the predefined Windows bitmap. The possible values are listed below from WINDOWS.H: OBM_BTNCORNERS OBM_OLD_RESTORE
OBM_BTSIZE OBM_OLD_RGARROW
OBM_CHECK OBM_OLD_UPARROW
OBM_CHECKBOXES OBM_OLD_ZOOM
OBM_CLOSE OBM_REDUCE
OBM_COMBO OBM_REDUCED
OBM_DNARROW OBM_RESTORE
OBM_DNARROWD OBM_RESTORED
OBM_DNARROWI OBM_RGARROW
OBM_LFARROW OBM_RGARROWD
OBM_LFARROWD OBM_RGARROWI
OBM_LFARROWI OBM_SIZE
OBM_MNARROW OBM_UPARROW
OBM_OLD_CLOSE OBM_UPARROWD
OBM_OLD_DNARROW OBM_UPARROW
OBM_OLD_LFARROW OBM_ZOOM
OBM_OLD_REDUCE OBM_ZOOMD

Return Value
Nonzero if successful; otherwise 0.

Remarks
Bitmap names that begin with OBM_OLD represent bitmaps used by Windows versions prior to 3.0.

Note that the constant OEMRESOURCE must be defined before including WINDOWS.H in order to use any of the OBM_ constants.

See Also
CBitmap Overview | Class Members | Hierarchy Chart | CBitmap::LoadBitmap | LoadBitmap

popkiler 2003-09-18
  • 打赏
  • 举报
回复
Q67709


--------------------------------------------------------------------------------
The information in this article applies to:

Microsoft Windows Software Development Kit (SDK) for Windows

--------------------------------------------------------------------------------


SUMMARY
All Windows version 3.0 and 3.1 display drivers are required to contain certain bitmaps. These bitmaps are used to paint various windows, controls, and menus. Handles to these bitmaps can be retrieved with the LoadBitmap() function. Below is an explanation of the OBM values listed in the Windows include file WINDOWS.H.

These values are parsed by the C Compiler only if OEMRESOURCE is defined prior to including WINDOWS.H.



MORE INFORMATION
The following file is available for download from the Microsoft Download Center. Click the file name below to download the file:


Sysbit.exe
For additional information about how to download Microsoft Support files, click the article number below to view the article in the Microsoft Knowledge Base:
Q119591 How to Obtain Microsoft Support Files from Online Services
Microsoft used the most current virus detection software available on the date of posting to scan this file for viruses. Once posted, the file is housed on secure servers that prevent any unauthorized changes to the file.



Because Windows buttons have two states, normal and depressed (the mouse pointer is over the icon and the mouse button is down), the first seven shapes (bitmaps) have two forms, the normal image and the depressed image. Both images are used to create the illusion of three dimensions on the screen when a button is pressed. The names of depressed images end with the letter "D"; the other images do not.

The last eleven bitmaps are no longer used by Windows, but must be supplied for compatibility with applications that expect them to be available.


Windows 3.1 Bitmaps


The following four bitmaps are new for Windows 3.1:



NOTE: The SYSBIT sample does not display these bitmaps, but they are
illustrated in the documentation (as are the rest of the bitmaps listed
below) for the LoadBitmap() function in the Windows SDK.




Resource Name Purpose
---------------------------------------------------------------------
OBM_DNARROWI A disabled down-pointing arrow for scroll bars.
OBM_LFARROWI A disabled left-pointing arrow for scroll bars.
OBM_RGARROWI A disabled right-pointing arrow for scroll bars.
OBM_UPARROWI A disabled up-pointing arrow for scroll bars.
Windows 3.00 Bitmaps

Resource Name Purpose
------------- ------- OBM_RESTORE Images used as the restore button on the title
OBM_RESTORED bar. This is the button with both an up and
down arrow which is only shown when a window is
maximized. OBM_REDUCE Images used as the minimize button on the title
OBM_REDUCED bar. OBM_ZOOM Images used as the maximize button on the title
OBM_ZOOMD bar. OBM_RGARROW A right-pointing arrow for scroll bars.
OBM_RGARROWD OBM_LFARROW A left-pointing arrow for scroll bars.
OBM_LFARROWD OBM_UPARROW An up-pointing arrow for scroll bars.
OBM_UPARROWD OBM_DNARROW A down-pointing arrow for scroll bars.
OBM_DNARROWD OBM_CLOSE A double-wide image that contains system menu box shapes for both main windows and MDI child
windows. OBM_CHECK A check mark used to check menu items. OBM_CHECKBOXES Ten images that are used to show different states of check boxes and radio buttons. The
images are organized in three rows of four
columns: Row 1
----- Column 1: Unchecked check box when the mouse is not pressed
over it. Column 2: Checked check box when the mouse is not pressed over
it. Column 3: Unchecked check box when the mouse is pressed over
it. Column 4: Checked check box when the mouse is pressed over it. Row 2
----- Column 1: Unchecked radio button when the mouse is not pressed
over it. Column 2: Checked radio button when the mouse is not pressed
over it. Column 3: Unchecked radio button when the mouse is pressed over
it. Column 4: Checked radio button when the mouse is pressed over
it. Row 3:
----- Column 1: Unused Column 2: Grayed check box when the mouse is not pressed over
it. Column 3: Unused Column 4: Grayed check box when the mouse is pressed over it. OBM_COMBO An arrow used for the push button in combo
boxes. OBM_MNARROW An arrow used to designate cascaded menu items.
Windows 1.x/2.x Bitmaps

Resource Name Purpose
------------- ------- OBM_SIZE A size box formerly used on tiled windows. OBM_BTSIZE A size box formerly used at the intersection of
vertical and horizontal scroll bars. OBM_OLD_RESTORE Image used for the Windows 2.x restore button
on a windows title bar. OBM_OLD_REDUCE Image used for the Windows 2.x minimize button
on a windows title bar. OBM_OLD_ZOOM Image used for the Windows 2.x maximize button
on a windows title bar. OBM_OLD_RGARROW A right-arrow bitmap used for Windows 2.x
scroll bars. OBM_OLD_LFARROW A left-arrow bitmap used for Windows 2.x scroll
bars. OBM_OLD_UPARROW An up-arrow bitmap used for Windows 2.x scroll
bars. OBM_OLD_DNARROW A down-arrow bitmap used for Windows 2.x scroll
bars. OBM_OLD_CLOSE The system menu bitmaps used for Windows 2.x. OBM_BTNCORNERS Small circles that Windows 2.x used to draw
rounded corners on button controls.

Additional query words: softlib SYSBIT

Keywords : kbfile kbsample kb16bitonly kbOSWin310 kbDSupport kbOSWin300 kbSDKWin16
Issue type : kbinfo
Technology :
xushinhwa2003 2003-09-17
  • 打赏
  • 举报
回复
有时路径太长就会出错.
lygfqy 2003-09-17
  • 打赏
  • 举报
回复
其实不过就是定义了一个整数嘛,实在不行用它本身定义的值代替其实也是可以的
试验了一下,应该是系统本身的图象,不过好像要#define 某些东西
具体因为WINUSER.H太长未详细研究了
fairyprince 2003-09-17
  • 打赏
  • 举报
回复
当然出错了
LoadBitmap((HINSTANCE) NULL,(LPTSTR)OBM_CHECK);

当第一个参数为空时,第二个参数代表文件名(是位图的)
bluebohe 2003-09-17
  • 打赏
  • 举报
回复
我也借地问一个小小的问题,CBitmap的成员函数
BOOL LoadBitmap( LPCTSTR lpszResourceName );
LPCTSTR lpszResourceName 到底是什么东西?BMP文件?还是可执行文件?还是资源的“别名”?我觉得是资源的“别名”可是没啥根据
MAKEINTRESOURCE是干什么的?

woaini5994 2003-09-17
  • 打赏
  • 举报
回复
CBitmap bp;
bp.LoadBitmap(ID..);
HBITMAP bm;
bp.GetBitemap(bm);
hbmCheck =bm;
我觉得是应该这样
popkiler 2003-09-16
  • 打赏
  • 举报
回复
'OBM_CHECK' ,'OBM_BTNCORNERS' 是否是属于系统自己的阿。
因为我在源程序上更本没有看到
littleboy73 2003-09-16
  • 打赏
  • 举报
回复
同意何志丹的意见
  • 打赏
  • 举报
回复
CBitmap bp;
bp.LoadBitmap(ID..);
HBITMAP hbmCheck = bp;

16,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

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