Click here to Skip to main content
15,904,348 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: problem with code after switching to visual studio 2005 Pin
Christian Graus24-Sep-06 12:34
protectorChristian Graus24-Sep-06 12:34 
GeneralRe: problem with code after switching to visual studio 2005 Pin
swatgodjr24-Sep-06 13:06
swatgodjr24-Sep-06 13:06 
GeneralRe: problem with code after switching to visual studio 2005 Pin
Christian Graus24-Sep-06 14:14
protectorChristian Graus24-Sep-06 14:14 
GeneralRe: problem with code after switching to visual studio 2005 Pin
swatgodjr24-Sep-06 14:50
swatgodjr24-Sep-06 14:50 
GeneralRe: problem with code after switching to visual studio 2005 Pin
Christian Graus24-Sep-06 15:01
protectorChristian Graus24-Sep-06 15:01 
GeneralRe: problem with code after switching to visual studio 2005 Pin
swatgodjr24-Sep-06 15:19
swatgodjr24-Sep-06 15:19 
GeneralRe: problem with code after switching to visual studio 2005 Pin
Christian Graus24-Sep-06 15:32
protectorChristian Graus24-Sep-06 15:32 
QuestionMemory Hogger!? Pin
MacGadger24-Sep-06 7:43
MacGadger24-Sep-06 7:43 
I want to Copy a Bitmap from the CImageList and copy to CBitmap object, i tried this function i tool from the Codeguru, but whenever i call this function everytime it increases the Memory usage of my Program. can anyone tell me how to control this ???

void GetImageFromList(CImageList *lstImages, int nImage, CBitmap *destBitmap)
{
//First we want to create a temporary image list we can manipulate
CImageList tmpList;
tmpList.Detach();
tmpList.Create(lstImages);

//Then swap the requested image to the first spot in the list
tmpList.Copy( 0, nImage, ILCF_SWAP );

//Now we need to get som information about the image
IMAGEINFO lastImage;
tmpList.GetImageInfo(0,&lastImage);

//Heres where it gets fun
//Create a Compatible Device Context using
//the valid DC of your calling window
CDC dcMem;
dcMem.CreateCompatibleDC (GetWindowDC());

//This rect simply stored the size of the image we need
CRect rect (lastImage.rcImage);

//Using the bitmap passed in, Create a bitmap
//compatible with the window DC
//We also know that the bitmap needs to be a certain size.
destBitmap->CreateCompatibleBitmap (this->GetWindowDC(),
rect.Width (), rect.Height ());

//Select the new destination bitmap into the DC we created above
CBitmap* pBmpOld = dcMem.SelectObject (destBitmap);

//This call apparently "draws" the bitmap from the list,
//onto the new destination bitmap
tmpList.DrawIndirect (&dcMem, 0, CPoint (0, 0),
CSize (rect.Width (), rect.Height ()), CPoint (0, 0));

//cleanup by reselecting the old bitmap object into the DC
dcMem.SelectObject (pBmpOld);

}

Please help me whts wrong in this CODE ? or if u have any idea how to Copy the Single Bitmap from Image list and copy to CBitmap tell me how ??
AnswerRe: Memory Hogger!? Pin
Christian Graus24-Sep-06 16:12
protectorChristian Graus24-Sep-06 16:12 
AnswerRe: Memory Hogger!? Pin
Hamid_RT26-Sep-06 6:31
Hamid_RT26-Sep-06 6:31 
QuestionCEdit and ON_EN_CHANGE [modified] Pin
Oliver12324-Sep-06 6:55
Oliver12324-Sep-06 6:55 
AnswerRe: CEdit and ON_EN_CHANGE Pin
Eytukan24-Sep-06 7:20
Eytukan24-Sep-06 7:20 
GeneralRe: CEdit and ON_EN_CHANGE Pin
toxcct25-Sep-06 23:01
toxcct25-Sep-06 23:01 
AnswerRe: CEdit and ON_EN_CHANGE Pin
Gary R. Wheeler24-Sep-06 11:07
Gary R. Wheeler24-Sep-06 11:07 
QuestionRegistry Question Pin
LiYS24-Sep-06 5:54
LiYS24-Sep-06 5:54 
AnswerRe: Registry Question Pin
PJ Arends24-Sep-06 9:43
professionalPJ Arends24-Sep-06 9:43 
QuestionRich Edit Printing Pin
LiYS24-Sep-06 5:43
LiYS24-Sep-06 5:43 
QuestionHow to open Dialog for choose folder Pin
Max++24-Sep-06 5:40
Max++24-Sep-06 5:40 
AnswerRe: How to open Dialog for choose folder Pin
eusto24-Sep-06 6:18
eusto24-Sep-06 6:18 
AnswerRe: How to open Dialog for choose folder Pin
tanvon malik24-Sep-06 6:22
tanvon malik24-Sep-06 6:22 
AnswerRe: How to open Dialog for choose folder Pin
tanvon malik24-Sep-06 6:36
tanvon malik24-Sep-06 6:36 
AnswerRe: How to open Dialog for choose folder Pin
Hamid_RT26-Sep-06 6:31
Hamid_RT26-Sep-06 6:31 
QuestionADO Recordsets and VC++ Pin
eusto24-Sep-06 5:08
eusto24-Sep-06 5:08 
QuestionFile input/output help Pin
eric_tran24-Sep-06 2:50
eric_tran24-Sep-06 2:50 
AnswerRe: File input/output help Pin
Eytukan24-Sep-06 3:16
Eytukan24-Sep-06 3:16 

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.