Click here to Skip to main content
15,891,621 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: AFX_MANAGE_STATE (AfxGetStaticModuleState ()) not working Pin
KingsGambit29-Dec-09 19:45
KingsGambit29-Dec-09 19:45 
GeneralRe: AFX_MANAGE_STATE (AfxGetStaticModuleState ()) not working Pin
Karismatic29-Dec-09 21:16
Karismatic29-Dec-09 21:16 
GeneralRe: AFX_MANAGE_STATE (AfxGetStaticModuleState ()) not working Pin
Madhu Nair29-Dec-09 21:43
Madhu Nair29-Dec-09 21:43 
Questionsending wav files using UPD protocol in vc++ Pin
janaswamy uday29-Dec-09 18:56
janaswamy uday29-Dec-09 18:56 
AnswerRe: sending wav files using UPD protocol in vc++ Pin
KingsGambit29-Dec-09 19:55
KingsGambit29-Dec-09 19:55 
AnswerRe: sending wav files using UPD protocol in vc++ Pin
raja jamwal31-Dec-09 8:22
raja jamwal31-Dec-09 8:22 
GeneralRe: sending wav files using UPD protocol in vc++ Pin
janaswamy uday1-Jan-10 23:44
janaswamy uday1-Jan-10 23:44 
Question[Resolved] CButtonST question, Remove the residue of old icon while setting a new icon with SetIcon [modified] Pin
Maxwell Chen29-Dec-09 18:51
Maxwell Chen29-Dec-09 18:51 
I am maintaining the source code which uses CButtonST buttons as icon controls to display transparent and overlay icons (for the small arrow at the corner of the main icon) on the GUI. User can change the icon.

When user is changing the icon, what I do in the code is to invoke CButtonST::SetIcon with another HICON handle. But there is the residue of the old icon which is unwanted. The new icon overlaps on top of the old one.

How to remove the old residue icon? Please advise. Thanks.

According to the comment by the author of CButtonST, calling SetIcon(0, 0) can remove any old icons from it.
[ quote ] // Pass NULL to remove any icon from the button. [ / quote ]
But in fact this call makes the application crash!


[Update]
I found someone had added two lines in CButtonST::FreeResources to do DeleteDC() and DeleteObject(). This issue was caused by these two calls. The problem is fixed after removing them. Big Grin | :-D

  Maxwell Chen

modified on Wednesday, December 30, 2009 3:36 AM

AnswerRe: CButtonST question, Remove the residue of old icon while setting a new icon with SetIcon Pin
KingsGambit29-Dec-09 19:47
KingsGambit29-Dec-09 19:47 
GeneralRe: CButtonST question, Remove the residue of old icon while setting a new icon with SetIcon Pin
Maxwell Chen29-Dec-09 20:03
Maxwell Chen29-Dec-09 20:03 
QuestionToolBar in singe document view Pin
Anu_Bala29-Dec-09 18:25
Anu_Bala29-Dec-09 18:25 
Questionmap Pin
ratprita29-Dec-09 17:35
ratprita29-Dec-09 17:35 
AnswerRe: map Pin
KingsGambit29-Dec-09 17:54
KingsGambit29-Dec-09 17:54 
GeneralRe: map Pin
ratprita29-Dec-09 18:08
ratprita29-Dec-09 18:08 
GeneralRe: map Pin
Tim Craig29-Dec-09 18:11
Tim Craig29-Dec-09 18:11 
GeneralRe: map Pin
KingsGambit29-Dec-09 18:23
KingsGambit29-Dec-09 18:23 
QuestionRe: map Pin
CPallini29-Dec-09 21:18
mveCPallini29-Dec-09 21:18 
AnswerRe: map Pin
ratprita29-Dec-09 21:23
ratprita29-Dec-09 21:23 
GeneralRe: map Pin
CPallini29-Dec-09 22:11
mveCPallini29-Dec-09 22:11 
JokeRe: map Pin
Maxwell Chen29-Dec-09 21:23
Maxwell Chen29-Dec-09 21:23 
QuestionTrouble loading a driver Pin
Mattzimmerer29-Dec-09 13:05
Mattzimmerer29-Dec-09 13:05 
AnswerRe: Trouble loading a driver Pin
Maxwell Chen29-Dec-09 19:06
Maxwell Chen29-Dec-09 19:06 
GeneralRe: Trouble loading a driver Pin
Mattzimmerer30-Dec-09 0:48
Mattzimmerer30-Dec-09 0:48 
Question[Message Deleted] Pin
noalias___29-Dec-09 12:55
noalias___29-Dec-09 12:55 
AnswerRe: library link error Pin
Chris Losinger29-Dec-09 12:59
professionalChris Losinger29-Dec-09 12:59 

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.