Click here to Skip to main content
16,011,804 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Inheritance. Pin
Chris Richardson19-Dec-02 18:59
Chris Richardson19-Dec-02 18:59 
GeneralRe: Inheritance. Pin
WREY19-Dec-02 21:49
WREY19-Dec-02 21:49 
GeneralRe: Inheritance. Pin
Chris Richardson20-Dec-02 7:03
Chris Richardson20-Dec-02 7:03 
GeneralRe: Inheritance. Pin
WREY20-Dec-02 7:24
WREY20-Dec-02 7:24 
QuestionHow to delete an HBITMAP? Pin
Joan M18-Dec-02 9:37
professionalJoan M18-Dec-02 9:37 
AnswerRe: How to delete an HBITMAP? Pin
Christian Graus18-Dec-02 9:49
protectorChristian Graus18-Dec-02 9:49 
GeneralRe: How to delete an HBITMAP? Pin
Joan M18-Dec-02 9:59
professionalJoan M18-Dec-02 9:59 
AnswerRe: How to delete an HBITMAP? Pin
Paul M Watt18-Dec-02 9:51
mentorPaul M Watt18-Dec-02 9:51 
You should only delete a bitmap if you created it. When you create a memory DC, it automatically has a default bitmap in it that windows will manage for you, I believe the same is true for the CStatic that you are talking about.

In order to delete a HBITMAP use ::DeleteObject(HBITMAP). There is one catch though, the bitmap cannot be selected into a memory DC otherwise the function will fail. So that is why you need to select the old bitmap into the memory DC before you call DeleteObject on the bitmap. Or you can delete the memory DC before you delete the bitmap, that will effectively unselect the bitmap from the memory DC as well.

Good Luck


Build a man a fire, and he will be warm for a day
Light a man on fire, and he will be warm for the rest of his life!

GeneralRe: How to delete an HBITMAP? Pin
Joan M18-Dec-02 9:59
professionalJoan M18-Dec-02 9:59 
GeneralWeird Case Pin
Sidney18-Dec-02 9:34
Sidney18-Dec-02 9:34 
GeneralRe: Weird Case Pin
Chris Richardson18-Dec-02 10:31
Chris Richardson18-Dec-02 10:31 
GeneralRe: Weird Case Pin
Sidney18-Dec-02 10:57
Sidney18-Dec-02 10:57 
GeneralRe: Weird Case Pin
Chris Richardson19-Dec-02 20:32
Chris Richardson19-Dec-02 20:32 
GeneralMFC Grid - How To Tab Out of... Pin
RFID Chris18-Dec-02 9:14
RFID Chris18-Dec-02 9:14 
GeneralReverse link list test Pin
Todd Smith18-Dec-02 8:49
Todd Smith18-Dec-02 8:49 
GeneralRe: Reverse link list test Pin
Tim Smith18-Dec-02 9:12
Tim Smith18-Dec-02 9:12 
QuestionDlls dialogs in FormViews? Pin
Ricky_TheBard18-Dec-02 8:27
Ricky_TheBard18-Dec-02 8:27 
QuestionFunctions to manage user profiles in a server ? Pin
Cris18-Dec-02 8:22
Cris18-Dec-02 8:22 
QuestionFlexible deriving a CAsyncSocket class? Pin
User 665818-Dec-02 7:56
User 665818-Dec-02 7:56 
Generalxlocale & xlocnum produce warnings at level 4 Pin
scott sanders18-Dec-02 6:01
scott sanders18-Dec-02 6:01 
GeneralRe: xlocale & xlocnum produce warnings at level 4 Pin
scott sanders18-Dec-02 10:25
scott sanders18-Dec-02 10:25 
GeneralXML filter for Indexing services Pin
Lucian MATEESCU18-Dec-02 5:29
Lucian MATEESCU18-Dec-02 5:29 
GeneralZooming a CDC Pin
S O S18-Dec-02 4:51
S O S18-Dec-02 4:51 
GeneralRe: Zooming a CDC Pin
Chris Losinger18-Dec-02 8:02
professionalChris Losinger18-Dec-02 8:02 
Generaldll question Pin
salah_gis18-Dec-02 4:48
salah_gis18-Dec-02 4:48 

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.