【急】为什么LoadBitmap返回总是0?解决方案

【急!】为什么LoadBitmap返回总是0?
为什么LoadBitmap返回总是0?
用GetLastError获取的错误码是1814

即使加载用VC生成的位图ID返回结果还是0,为什么呀?

------解决方案--------------------
因为你的代码写的不对。
你不会以为是LoadBitmap函数是个错误的函数吧?
------解决方案--------------------
可能是你的位图有问题
------解决方案--------------------
把你的代码贴出来看看。。。
------解决方案--------------------
HBITMAP LoadBitmap(
HINSTANCE hInstance, // handle to application instance
LPCTSTR lpBitmapName // name of bitmap resource
);

Remarks
If the bitmap pointed to by the lpBitmapName parameter does not exist or there is insufficient memory to load the bitmap, the function fails. 

LoadBitmap creates a compatible bitmap of the display, which cannot be selected to a printer. To load a bitmap that you can select to a printer, call LoadImage and specify LR_CREATEDIBSECTION to create a DIB section. A DIB section can be selected to any device.

An application can use the LoadBitmap function to access the predefined bitmaps used by the Win32 API. To do so, the application must set the hInstance parameter to NULL and the lpBitmapName parameter to one of the following values. 


探讨
引用
不贴代码型


代码就是这样,很简单:

HBITMAP hBitmap = NULL;
DWORD dwError = 0;

hBitmap = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_BITMAP1)); //执行后hBitmap是0
dwError = GetLastError(); // 执行后 dwError……