Click here to Skip to main content
15,911,785 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: TerminateProcess w2k and xp! Pin
Tomasz Sowinski11-Mar-04 3:06
Tomasz Sowinski11-Mar-04 3:06 
GeneralRe: TerminateProcess w2k and xp! Pin
ceuba11-Mar-04 3:33
ceuba11-Mar-04 3:33 
GeneralRe: TerminateProcess w2k and xp! Pin
Tomasz Sowinski11-Mar-04 3:46
Tomasz Sowinski11-Mar-04 3:46 
GeneralConvert CString to Unsigned Long Pin
Caoimh11-Mar-04 0:41
Caoimh11-Mar-04 0:41 
GeneralRe: Convert CString to Unsigned Long Pin
toxcct11-Mar-04 0:46
toxcct11-Mar-04 0:46 
GeneralRe: Convert CString to Unsigned Long Pin
David Crow11-Mar-04 2:39
David Crow11-Mar-04 2:39 
GeneralRe: Convert CString to Unsigned Long Pin
Steve S11-Mar-04 2:52
Steve S11-Mar-04 2:52 
GeneralRe: Convert CString to Unsigned Long Pin
Michael Haephrati12-Apr-15 9:39
professionalMichael Haephrati12-Apr-15 9:39 
Questionmust I port time critical code from Visual C++ 6.0 to 7.0 ? Pin
GuimaSun11-Mar-04 0:30
GuimaSun11-Mar-04 0:30 
AnswerRe: must I port time critical code from Visual C++ 6.0 to 7.0 ? Pin
Tomasz Sowinski11-Mar-04 2:54
Tomasz Sowinski11-Mar-04 2:54 
Generalsolve expression Pin
Member 169706311-Mar-04 0:25
Member 169706311-Mar-04 0:25 
GeneralRe: solve expression Pin
Prakash Nadar11-Mar-04 0:38
Prakash Nadar11-Mar-04 0:38 
GeneralRe: solve expression Pin
Robert A. T. Káldy11-Mar-04 0:56
Robert A. T. Káldy11-Mar-04 0:56 
GeneralRe: solve expression Pin
David Crow11-Mar-04 2:51
David Crow11-Mar-04 2:51 
GeneralConverting To Pixels Pin
Pazzuzu10-Mar-04 23:43
Pazzuzu10-Mar-04 23:43 
GeneralRe: Converting To Pixels Pin
Robert A. T. Káldy11-Mar-04 0:08
Robert A. T. Káldy11-Mar-04 0:08 
GeneralRe: Converting To Pixels Pin
Pazzuzu11-Mar-04 1:28
Pazzuzu11-Mar-04 1:28 
GeneralStoring the visual representation in a document Pin
mymauve2110-Mar-04 23:03
mymauve2110-Mar-04 23:03 
GeneralStoring the visual representation in a document Pin
mymauve2110-Mar-04 23:02
mymauve2110-Mar-04 23:02 
GeneralRe: Storing the visual representation in a document Pin
David Crow11-Mar-04 2:53
David Crow11-Mar-04 2:53 
GeneralBitmap Pin
Rassul Yunussov10-Mar-04 22:48
Rassul Yunussov10-Mar-04 22:48 
GeneralRe: Bitmap Pin
Mike Dimmick11-Mar-04 1:01
Mike Dimmick11-Mar-04 1:01 
GeneralRe: Bitmap Pin
Rassul Yunussov11-Mar-04 22:20
Rassul Yunussov11-Mar-04 22:20 
GeneralRe: Bitmap Pin
Mike Dimmick12-Mar-04 8:36
Mike Dimmick12-Mar-04 8:36 
Firstly I'd pull out every use of GetSystemMetrics(SM_CXSCREEN) and GSM(SM_CYSCREEN) and store them in variables instead - this will make the code clearer.

The value of a two-character literal is undefined. Set BFH.bfType to 0x4D42.

The documentation for BITMAPINFOHEADER indicates that biPlanes should be set to 1. I think you can get away with setting biClrUsed to zero; if you do this, you should not write any RGBQUAD structures after the BITMAPINFOHEADER.

biCompression should be set to BI_RGB. You should probably set biXPelsPerMeter and biYPelsPerMeter: you can either compute them from GetDeviceCaps( hDC, LOGPIXELSX ) or simply write in the appropriate value for 96dpi: 3780.

A line of a DIB is always an exact multiple of 4 bytes long. If the number of bytes per pixel multiplied by the number of pixels per line is not a multiple of 4, you must round up to the next multiple. This also affects your original block allocation.

I seem to remember that there are also some odd alignment requirements for a BMP file, but I can't remember them off-hand.

If other programs render your bitmap upside down, you may need to set biHeight to a negative value (e.g. -480 for a 480-pixel high image).

If none of this helps, step through the code and see which line fails, and what the Windows error value is.

Stability. What an interesting concept. -- Chris Maunder
GeneralDraw a great circle of a sphere in c++ Pin
Tal S.10-Mar-04 22:40
Tal S.10-Mar-04 22:40 

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.