Click here to Skip to main content
15,923,689 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Compare two bitmap Pin
MAAK14-Feb-03 2:41
MAAK14-Feb-03 2:41 
GeneralRe: Compare two bitmap Pin
jeremysay14-Feb-03 3:18
jeremysay14-Feb-03 3:18 
GeneralRe: Compare two bitmap Pin
jeremysay14-Feb-03 4:27
jeremysay14-Feb-03 4:27 
GeneralRe: Compare two bitmap Pin
MAAK14-Feb-03 6:14
MAAK14-Feb-03 6:14 
GeneralRe: Compare two bitmap Pin
jeremysay14-Feb-03 10:23
jeremysay14-Feb-03 10:23 
GeneralRe: Compare two bitmap Pin
MAAK14-Feb-03 15:13
MAAK14-Feb-03 15:13 
GeneralRe: Compare two bitmap Pin
jeremysay14-Feb-03 21:48
jeremysay14-Feb-03 21:48 
GeneralRe: Compare two bitmap Pin
MAAK14-Feb-03 23:14
MAAK14-Feb-03 23:14 
You wrote in the last reply the code for obtaining one of the bitmaps, but you did not wrote how the other is obtained (and did not say if it was the same way or not).

Any way put this diagnositc lines of code before the if(memcmp(...
if(data1 == 0)
   AfxMessageBox("Error in bitmap 1");
if(data2 == 0)
   AfxMessageBox("Error in bitmap 2");


if the data of an HBITMAP is NULL then it should be either a DDB or and invalid handle, however if it's invalid handle the BITMAP structure won't be obtain in the first place. So, if the BITMAP structure is obtained successfully and the data is NULL then it's probably a DDB. If you debugged the program and stepped after the two calls to GetObject() you may check the values of the bmp1 and bmp2, if the HBITMAP is for a DDB you'll see all the members have normal values except the bmBits, which will contain 0.

By the way, do not compare the BITMAP structure using memcmp() because if both are inavalid you may obtain unexpected reults
GeneralRe: Compare two bitmap Pin
jeremysay17-Feb-03 3:10
jeremysay17-Feb-03 3:10 
GeneralRe: Compare two bitmap Pin
jeremysay14-Feb-03 5:01
jeremysay14-Feb-03 5:01 
GeneralRe: Compare two bitmap Pin
includeh1014-Feb-03 23:57
includeh1014-Feb-03 23:57 
GeneralMFC accelerators & activeX Pin
peterchen13-Feb-03 22:47
peterchen13-Feb-03 22:47 
GeneralGet the HWND value of a Dialog Pin
Willem B13-Feb-03 22:41
Willem B13-Feb-03 22:41 
GeneralRe: Get the HWND value of a Dialog Pin
bryce13-Feb-03 22:50
bryce13-Feb-03 22:50 
GeneralRe: Get the HWND value of a Dialog Pin
Willem B13-Feb-03 23:03
Willem B13-Feb-03 23:03 
GeneralRe: Get the HWND value of a Dialog Pin
bryce13-Feb-03 23:08
bryce13-Feb-03 23:08 
GeneralRe: Get the HWND value of a Dialog Pin
Willem B13-Feb-03 23:13
Willem B13-Feb-03 23:13 
Generalhide titlebar Pin
bryce13-Feb-03 22:25
bryce13-Feb-03 22:25 
GeneralRe: hide titlebar Pin
Hans Ruck13-Feb-03 23:07
Hans Ruck13-Feb-03 23:07 
Generalissue caused precompiled header Pin
dsuratman13-Feb-03 20:38
dsuratman13-Feb-03 20:38 
GeneralRe: issue caused precompiled header Pin
Michael Dunn13-Feb-03 23:30
sitebuilderMichael Dunn13-Feb-03 23:30 
Generaldev Pin
Anonymous13-Feb-03 19:28
Anonymous13-Feb-03 19:28 
Generaluint40 Pin
Victor Boctor13-Feb-03 18:10
Victor Boctor13-Feb-03 18:10 
GeneralRe: uint40 Pin
Joaquín M López Muñoz13-Feb-03 20:13
Joaquín M López Muñoz13-Feb-03 20:13 
GeneralRe: uint40 (VC++ __int64 Implementation) Pin
MAAK14-Feb-03 1:54
MAAK14-Feb-03 1:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.