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

C / C++ / MFC

 
QuestionLooking for a MSXML tutorial Pin
super_ttd17-Jan-07 3:14
super_ttd17-Jan-07 3:14 
QuestionRe: Looking for a MSXML tutorial Pin
prasad_som17-Jan-07 4:54
prasad_som17-Jan-07 4:54 
AnswerRe: Looking for a MSXML tutorial Pin
super_ttd17-Jan-07 5:17
super_ttd17-Jan-07 5:17 
AnswerRe: Looking for a MSXML tutorial Pin
prasad_som17-Jan-07 18:12
prasad_som17-Jan-07 18:12 
QuestionMemory Leak please help Pin
uday kiran janaswamy17-Jan-07 3:11
uday kiran janaswamy17-Jan-07 3:11 
QuestionRe: Memory Leak please help Pin
prasad_som17-Jan-07 3:17
prasad_som17-Jan-07 3:17 
AnswerRe: Memory Leak please help Pin
uday kiran janaswamy17-Jan-07 3:23
uday kiran janaswamy17-Jan-07 3:23 
GeneralRe: Memory Leak please help Pin
uday kiran janaswamy17-Jan-07 3:28
uday kiran janaswamy17-Jan-07 3:28 
Hi Prasad,

The Code i am giving will get you clear picture.

//====================================================
HICON CGTD2to32ColorWnd::mf_GetSelectedLibClrIcon()
{
return mf_GetLibClrIcon(mui_ColorSelected);
}
//=====================================================

which inturn calls this function

//=====================================================

HICON CGTD2to32ColorWnd::mf_GetLibClrIcon(long pl_LibClr)
{
CImageList *lpi_LibToolbarImageList = NULL;
HICON lH_Icon = NULL;
HICON lH_ReturnedIcon = NULL;

// Get the Toolbar internal imagelist.
if(pl_LibClr == ID_NOCOLOR_SELECTED && mb_ShowAllColorButton)
{
lpi_LibToolbarImageList = mC_wndAllColorToolBar.GetToolBarCtrl().GetImageList();
}
else
{
lpi_LibToolbarImageList = mC_wndColorToolBar.GetToolBarCtrl().GetImageList();
}

int li_BtnIdx = mf_GetLibButtonIndex(pl_LibClr);

// Extract the HICON from the toolbar's Image list for the currently selected
// Patten and return the same.
if(lpi_LibToolbarImageList)
{
lH_Icon=lpi_LibToolbarImageList->ExtractIcon(li_BtnIdx);
// Copies the lH_PattrenIcon into lH_ReturnedIcon and deletes the lH_PattrenIcon.
lH_ReturnedIcon = (HICON)(::CopyImage(lH_Icon,IMAGE_ICON,0,0,LR_COPYDELETEORG));
lH_Icon = NULL;
}

// Retrun the copied Icon.
return lH_ReturnedIcon;
}

//=====================================================

in short it will Copy the Icon using

lH_ReturnedIcon = (HICON)(::CopyImage(lH_Icon,IMAGE_ICON,0,0,LR_COPYDELETEORG));

and Return the Icon Handle

Uday kiran

AnswerRe: Memory Leak please help Pin
prasad_som17-Jan-07 4:19
prasad_som17-Jan-07 4:19 
QuestionRe: Memory Leak please help Pin
David Crow17-Jan-07 3:25
David Crow17-Jan-07 3:25 
AnswerRe: Memory Leak please help Pin
uday kiran janaswamy17-Jan-07 3:33
uday kiran janaswamy17-Jan-07 3:33 
GeneralRe: Memory Leak please help Pin
jhwurmbach17-Jan-07 5:09
jhwurmbach17-Jan-07 5:09 
QuestionBase Conversion? Pin
nutkase17-Jan-07 2:32
nutkase17-Jan-07 2:32 
AnswerRe: Base Conversion? Pin
toxcct17-Jan-07 2:38
toxcct17-Jan-07 2:38 
AnswerRe: Base Conversion? Pin
Cedric Moonen17-Jan-07 2:41
Cedric Moonen17-Jan-07 2:41 
QuestionRe: Base Conversion? Pin
David Crow17-Jan-07 2:46
David Crow17-Jan-07 2:46 
AnswerRe: Base Conversion? Pin
nutkase17-Jan-07 2:59
nutkase17-Jan-07 2:59 
QuestionRe: Base Conversion? Pin
David Crow17-Jan-07 3:20
David Crow17-Jan-07 3:20 
AnswerRe: Base Conversion? Pin
nutkase17-Jan-07 3:23
nutkase17-Jan-07 3:23 
QuestionRe: Base Conversion? Pin
David Crow17-Jan-07 3:34
David Crow17-Jan-07 3:34 
GeneralRe: Base Conversion? Pin
nutkase17-Jan-07 3:35
nutkase17-Jan-07 3:35 
QuestionRe: Base Conversion? Pin
David Crow17-Jan-07 3:47
David Crow17-Jan-07 3:47 
QuestionDirectX SDK Pin
Waldermort17-Jan-07 2:31
Waldermort17-Jan-07 2:31 
AnswerRe: DirectX SDK Pin
cje18-Jan-07 8:02
cje18-Jan-07 8:02 
Question#pragma deprecated Pin
si_6917-Jan-07 2:26
si_6917-Jan-07 2:26 

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.