Click here to Skip to main content
15,900,108 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralUser created menu, using New Selection. Pin
Eversman21-May-04 14:19
Eversman21-May-04 14:19 
QuestionCapturing keyboard input from inside a background WMP9 COM plugin? Pin
IGx8921-May-04 13:47
IGx8921-May-04 13:47 
AnswerRe: Capturing keyboard input from inside a background WMP9 COM plugin? Pin
Michael Dunn21-May-04 14:06
sitebuilderMichael Dunn21-May-04 14:06 
GeneralRe: Capturing keyboard input from inside a background WMP9 COM plugin? Pin
IGx8921-May-04 15:45
IGx8921-May-04 15:45 
AnswerRe: Capturing keyboard input from inside a background WMP9 COM plugin? Pin
Blake Miller25-May-04 15:42
Blake Miller25-May-04 15:42 
GeneralRe: Capturing keyboard input from inside a background WMP9 COM plugin? Pin
IGx8925-May-04 16:05
IGx8925-May-04 16:05 
Generalraw data to bitmap Pin
Snillet2k21-May-04 12:17
Snillet2k21-May-04 12:17 
GeneralRe: raw data to bitmap Pin
John R. Shaw22-May-04 17:51
John R. Shaw22-May-04 17:51 
First:
if (!memcpy((LPSTR)hDIB, vBits, nPackedDIBLen))

well normaly I would have called GlobalLock() to get the pointer, but hDIB is realy a pointer so this should work ( LPSTR should be LPVOID ).

The problem with the line is that vBits points to the start of the buffer, where the BITMAPFILEHEADER is stored and you are trying to copy the information following it:

if (!memcpy((LPSTR)hDIB, (LPBYTE)vBits + sizeof(BITMAPFILEHEADER), nPackedDIBLen))

That should fix the following:

BITMAPINFOHEADER &bmiHeader = *(LPBITMAPINFOHEADER)hDIB ; // Gets wrong data
BITMAPINFO &bmInfo = *(LPBITMAPINFO)hDIB ;

(interesting use of references!)

Try takeing a look at the CDibData article; I wrote the class so that it could take a handle to a DIB (see CDibData::Attach()) just like the clipboard.

INTP
GeneralUnknown Usr Breakpoint causes program halting!?!?! Pin
Wheatbread21-May-04 10:57
Wheatbread21-May-04 10:57 
GeneralRe: Unknown Usr Breakpoint causes program halting!?!?! Pin
Alexander M.,23-May-04 9:50
Alexander M.,23-May-04 9:50 
GeneralKeyboard Accelerators for CFormView Pin
brdavid21-May-04 9:54
brdavid21-May-04 9:54 
General_inp and _outp Pin
eggie521-May-04 9:35
eggie521-May-04 9:35 
GeneralRe: _inp and _outp Pin
21-May-04 10:54
suss21-May-04 10:54 
GeneralRe: _inp and _outp Pin
eggie521-May-04 11:01
eggie521-May-04 11:01 
GeneralRe: _inp and _outp Pin
21-May-04 12:29
suss21-May-04 12:29 
GeneralRe: _inp and _outp Pin
Prakash Nadar21-May-04 16:45
Prakash Nadar21-May-04 16:45 
GeneralRe: _inp and _outp Pin
eggie521-May-04 18:17
eggie521-May-04 18:17 
GeneralStrFormatByteSize() Pin
DanYELL21-May-04 9:29
DanYELL21-May-04 9:29 
GeneralRe: StrFormatByteSize() Pin
Michael Dunn21-May-04 12:57
sitebuilderMichael Dunn21-May-04 12:57 
GeneralRe: StrFormatByteSize() Pin
DanYELL21-May-04 15:20
DanYELL21-May-04 15:20 
QuestionCorrect Usage of WaitCommEvent? Pin
AnotherProgrammer21-May-04 8:31
AnotherProgrammer21-May-04 8:31 
AnswerFurthermore... (another question - about ReadFile this time) Pin
AnotherProgrammer21-May-04 8:40
AnotherProgrammer21-May-04 8:40 
AnswerRe: Correct Usage of WaitCommEvent? Pin
Antti Keskinen23-May-04 0:08
Antti Keskinen23-May-04 0:08 
GeneralSubclassed ActiveX control Pin
BlackDice21-May-04 7:01
BlackDice21-May-04 7:01 
GeneralRe: Subclassed ActiveX control Pin
Antti Keskinen21-May-04 7:44
Antti Keskinen21-May-04 7:44 

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.