Click here to Skip to main content
15,909,030 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: some tables in oracle dones not permit Add()? Pin
Michael P Butler11-Dec-02 22:08
Michael P Butler11-Dec-02 22:08 
GeneralHelp me! Pin
SmilingHeart11-Dec-02 15:02
SmilingHeart11-Dec-02 15:02 
GeneralRe: Help me! Pin
Christian Graus11-Dec-02 15:56
protectorChristian Graus11-Dec-02 15:56 
GeneralRe: Help me! Pin
SmilingHeart11-Dec-02 21:12
SmilingHeart11-Dec-02 21:12 
GeneralRe: Help me! Pin
Christian Graus11-Dec-02 21:36
protectorChristian Graus11-Dec-02 21:36 
QuestionHow to send message to Messenger Service in app? Pin
wangdave11-Dec-02 13:55
wangdave11-Dec-02 13:55 
AnswerRe: How to send message to Messenger Service in app? Pin
Kannan Kalyanaraman11-Dec-02 19:01
Kannan Kalyanaraman11-Dec-02 19:01 
GeneralPointers and SetDIBitsToDevice Question Pin
ursus zeta11-Dec-02 13:17
ursus zeta11-Dec-02 13:17 
I am a novice to Visual C++ and windows programming, and so am attempting to acquire my understanding of it from Charles Petzold's: Programming Windows. No doubt many of you are familiar with it.
I am becoming confused in using the SetDIBitsToDevice function that I am using to display bitmaps, that I have imported as a resource in the executable.
And, so I have several questions about pointers, handles, and casting.
In his book, Petzold describes supplying the necessary parameters, when calling the SetDIBitsToDevive function:
"For the SetDIBitsToDevice and StretchDIBits functions, the information you need includes a pointer to the BITMAPINFO structure of the DIB. As you'll recall, the BITMAPINFO structure comprises the BITMAPINFOHEADER structure and the color table. So, this is simply a pointer to the packed DIB with appropriate casting." Do any of you understand what he is referring to when he says, 'appropriate casting'?
Also, another question: I would like to display the bitmaps by using the FindResource and LoadImage function calls, which both return handles. Is there a way to use handles either as pointers, or by converting them safely to appropriate BITMAPINFO pointers and as pointers to the actual bitmap image bits? Is there a preferred casting operator that be used here?
This is a description of how the author acquires the pointer to the image pixel bits:
"The functions also require a pointer to the pixel bits. This is derivable from information in the information header, although the code is not pretty. Notice that this pointer can be calculated much more easily when you have access to the bfOffBits field of the BITMAPFILEHEADER structure. The bfOffBits field indicates the offset from the beginning of the DIB file to the pixel bits. You could simply add this offset to the BITMAPINFO pointer and then subtract the size of the BITMAPFILEHEADER structure. However, this doesn't help when you get a pointer to a packed DIB from the clipboard, because you don't have a BITMAPFILEHEADER structure."
I imagine a n umber of you folks write programs for image processing, and have an intimate understanding of the mechanics involved here. I would appreciate any information. Thanks.
GeneralRe: Pointers and SetDIBitsToDevice Question Pin
dan o12-Dec-02 5:39
dan o12-Dec-02 5:39 
QuestionWhere to make is a Loop? Pin
Autunmsky11-Dec-02 13:04
Autunmsky11-Dec-02 13:04 
AnswerRe: Where to make is a Loop? Pin
carrie11-Dec-02 13:33
carrie11-Dec-02 13:33 
GeneralRe: Where to make is a Loop? Pin
Autunmsky11-Dec-02 13:42
Autunmsky11-Dec-02 13:42 
GeneralRe: Where to make is a Loop? Pin
Christian Graus11-Dec-02 15:55
protectorChristian Graus11-Dec-02 15:55 
GeneralRe: Where to make is a Loop? Pin
Autunmsky11-Dec-02 16:10
Autunmsky11-Dec-02 16:10 
GeneralRe: Where to make is a Loop? Pin
Paul M Watt11-Dec-02 17:17
mentorPaul M Watt11-Dec-02 17:17 
GeneralRe: Where to make is a Loop? Pin
carrie11-Dec-02 20:54
carrie11-Dec-02 20:54 
GeneralRe: Where to make is a Loop? Pin
Christian Graus11-Dec-02 20:57
protectorChristian Graus11-Dec-02 20:57 
GeneralPointer error with SendMessage() and LPARAM Pin
Johann Gerell11-Dec-02 12:34
Johann Gerell11-Dec-02 12:34 
GeneralRe: Pointer error with SendMessage() and LPARAM Pin
Paul M Watt11-Dec-02 12:42
mentorPaul M Watt11-Dec-02 12:42 
GeneralRe: Pointer error with SendMessage() and LPARAM Pin
Johann Gerell11-Dec-02 13:54
Johann Gerell11-Dec-02 13:54 
GeneralRe: Pointer error with SendMessage() and LPARAM Pin
Tim Smith12-Dec-02 2:31
Tim Smith12-Dec-02 2:31 
GeneralRe: Pointer error with SendMessage() and LPARAM Pin
Michael Dunn11-Dec-02 14:55
sitebuilderMichael Dunn11-Dec-02 14:55 
GeneralRe: Pointer error with SendMessage() and LPARAM Pin
Ravi Bhavnani11-Dec-02 12:50
professionalRavi Bhavnani11-Dec-02 12:50 
GeneralRe: Pointer error with SendMessage() and LPARAM Pin
Johann Gerell11-Dec-02 13:56
Johann Gerell11-Dec-02 13:56 
GeneralRe: Pointer error with SendMessage() and LPARAM Pin
Ravi Bhavnani12-Dec-02 4:03
professionalRavi Bhavnani12-Dec-02 4:03 

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.