Click here to Skip to main content
15,915,833 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: RGB differences Windows 2000 vs XP Pin
kildareflare6-Aug-08 4:08
kildareflare6-Aug-08 4:08 
QuestionVC7 libs on VC8 Pin
vikramlinux6-Aug-08 0:54
vikramlinux6-Aug-08 0:54 
AnswerRe: VC7 libs on VC8 Pin
Chris Losinger6-Aug-08 13:35
professionalChris Losinger6-Aug-08 13:35 
QuestionCritical section failed! Pin
SRKSHOME6-Aug-08 0:29
SRKSHOME6-Aug-08 0:29 
AnswerRe: Critical section failed! Pin
SandipG 6-Aug-08 0:37
SandipG 6-Aug-08 0:37 
GeneralRe: Critical section failed! Pin
SRKSHOME6-Aug-08 1:30
SRKSHOME6-Aug-08 1:30 
GeneralRe: Critical section failed! Pin
SandipG 6-Aug-08 1:36
SandipG 6-Aug-08 1:36 
QuestionHow to change a single toolbar icon at runtime? Pin
madmax00015-Aug-08 23:54
madmax00015-Aug-08 23:54 
Hello,

I have a toolbar with several icons in it and there is one icon that I must change at runtime. How can I manage this?
I have tried someting like this, but the code crashes...

CToolBarCtrl& tb = m_wndToolBar.GetToolBarCtrl();
int iButtonCount = tb.GetButtonCount();

CDC dcMemToolbar;
CDC dcMemSrc;
CBitmap SrcBmp;
CBitmap NewBmp;
CBitmap* pOldSrcBmp = NULL;
CDC* pDc = GetDC();
dcMemToolbar.CreateCompatibleDC(pDc);
dcMemSrc.CreateCompatibleDC(pDc);

SrcBmp.LoadBitmap(IDB_TOOLBAR);
pOldSrcBmp = dcMemSrc.SelectObject(&SrcBmp);
dcMemToolbar.BitBlt(0, 0, iButtonCount*16, 16, &dcMemSrc, 0, 0, SRCCOPY);

NewBmp.LoadBitmap(IDB_INVALID_ICON);
dcMemSrc.SelectObject(&NewBmp);
dcMemToolbar.BitBlt(0, 0, 16, 16, &dcMemSrc, 0, 0, SRCCOPY);

dcMemSrc.SelectObject(pOldSrcBmp);

m_wndToolBar.SetBitmap(SrcBmp);


Thank you
AnswerRe: How to change a single toolbar icon at runtime? Pin
Sarath C6-Aug-08 0:12
Sarath C6-Aug-08 0:12 
Questionmerge proxy/stub code in ATL server Pin
George_George5-Aug-08 23:46
George_George5-Aug-08 23:46 
QuestionRe: merge proxy/stub code in ATL server Pin
led mike6-Aug-08 4:32
led mike6-Aug-08 4:32 
AnswerRe: merge proxy/stub code in ATL server Pin
George_George6-Aug-08 19:40
George_George6-Aug-08 19:40 
GeneralRe: merge proxy/stub code in ATL server Pin
led mike7-Aug-08 7:13
led mike7-Aug-08 7:13 
GeneralRe: merge proxy/stub code in ATL server Pin
George_George8-Aug-08 23:30
George_George8-Aug-08 23:30 
QuestionHow to loop through a directory Pin
santhoshv845-Aug-08 23:40
santhoshv845-Aug-08 23:40 
AnswerRe: How to loop through a directory Pin
_AnsHUMAN_ 6-Aug-08 0:02
_AnsHUMAN_ 6-Aug-08 0:02 
AnswerRe: How to loop through a directory Pin
Sarath C6-Aug-08 0:06
Sarath C6-Aug-08 0:06 
GeneralRe: How to loop through a directory Pin
Sarath C6-Aug-08 0:10
Sarath C6-Aug-08 0:10 
AnswerRe: How to loop through a directory Pin
Jijo.Raj6-Aug-08 0:09
Jijo.Raj6-Aug-08 0:09 
JokeRe: How to loop through a directory [modified] Pin
SandipG 6-Aug-08 0:11
SandipG 6-Aug-08 0:11 
JokeRe: How to loop through a directory Pin
Jijo.Raj6-Aug-08 0:14
Jijo.Raj6-Aug-08 0:14 
GeneralRe: How to loop through a directory Pin
Jijo.Raj6-Aug-08 1:01
Jijo.Raj6-Aug-08 1:01 
QuestionRe: How to loop through a directory Pin
David Crow6-Aug-08 7:20
David Crow6-Aug-08 7:20 
QuestionCreateFile OPEN_EXISTING problem in Vista Pin
NiceNaidu5-Aug-08 23:37
NiceNaidu5-Aug-08 23:37 
AnswerRe: CreateFile OPEN_EXISTING problem in Vista Pin
SandipG 6-Aug-08 0:03
SandipG 6-Aug-08 0: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.