GetCurrentObject

steve.lustbader at philips.com steve.lustbader at philips.com
Fri Nov 8 16:56:05 CST 2002


GetCurrentObject returns 0, but as far as it knows, it is
returning successfully.  This is because in the line

case OBJ_BITMAP: ret = dc->hBitmap; break;

dc->hBitmap is 0, although dc is a valid DC.  The HDC that is passed
to GetCurrentObject to get dc is obtained by calling
CWindow::BegingPaint(PAINTSTRUCT *) from a class derived from ATL's
CWindow.  I'm guessing that this is where the problem is probably
coming from - the app is written in C++ with ATL.

-Steve




I've seen this occur when wine frees a gdi handle it shouldn't. Check
that the OBJ_BITMAP handle is really valid.

Also wierd stuff can occur if the app expects a HDIB but we provide it a
HBITMAP... or vice versa.

Mike

steve.lustbader at philips.com wrote:
> My app calls GetCurrentObject with a valid HDC and OBJ_BITMAP.
> It returns 0, however, which causes my app to crash.  What further
> info can I provide to help debug this?
>
> -Steve
>









More information about the wine-devel mailing list