Share via


CBitmap::LoadBitmap

BOOLLoadBitmap(LPCTSTRlpszResourceName**);**

BOOLLoadBitmap(UINTnIDResource**);**

Return Value

Nonzero if successful; otherwise 0.

Parameters

lpszResourceName

Points to a null-terminated string that contains the name of the bitmap resource.

nIDResource

Specifies the resource ID number of the bitmap resource.

Remarks

Loads the bitmap resource named by lpszResourceName or identified by the ID number in nIDResource from the application’s executable file. The loaded bitmap is attached to the CBitmap object.

If the bitmap identified by lpszResourceName does not exist or if there is insufficient memory to load the bitmap, the function returns 0.

You can use the CGdiObject::DeleteObject function to delete bitmap loaded by the LoadBitmap function, or the CBitmap destructor will delete the object for you.

! WARNING   Before you delete the object, make sure it is not selected into a device context.

The following bitmaps were added to Windows versions 3.1 and later:

OBM_UPARRROWI
OBM_DNARROWI
OBM_RGARROWI
OBM_LFARROWI

These bitmaps are not found in device drivers for Windows versions 3.0 and earlier. For a complete list of bitmaps and a display of their appearance, see the Win32 Programmer’s Reference.

CBitmap OverviewClass MembersHierarchy Chart

See Also   CBitmap::LoadOEMBitmap, , CGdiObject::DeleteObject