Click here to Skip to main content
15,888,527 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: imbue( locale("") ) crashing Pin
ed welch2-Mar-11 0:07
ed welch2-Mar-11 0:07 
QuestionImage::GetThumbnailImage() issue Pin
David Crow1-Mar-11 9:07
David Crow1-Mar-11 9:07 
AnswerRe: Image::GetThumbnailImage() issue Pin
Hans Dietrich1-Mar-11 11:26
mentorHans Dietrich1-Mar-11 11:26 
AnswerRe: Image::GetThumbnailImage() issue Pin
Niklas L1-Mar-11 11:51
Niklas L1-Mar-11 11:51 
GeneralRe: Image::GetThumbnailImage() issue Pin
David Crow2-Mar-11 2:22
David Crow2-Mar-11 2:22 
GeneralRe: Image::GetThumbnailImage() issue Pin
Niklas L2-Mar-11 5:54
Niklas L2-Mar-11 5:54 
QuestionRe: Image::GetThumbnailImage() issue [modified] Pin
David Crow2-Mar-11 6:18
David Crow2-Mar-11 6:18 
AnswerRe: Image::GetThumbnailImage() issue Pin
Niklas L2-Mar-11 8:45
Niklas L2-Mar-11 8:45 
I was going to suggest this:
C++
CImage img;
img.Load("narrow.bmp");

COLORREF clrFill = RGB(255, 255, 255);
int leftEdge = (16 / 2) - img.GetWidth() / 2;

CDC *pDC = GetDC();
CDC dc;
dc.CreateCompatibleDC(pDC);
ReleaseDC(pDC);
CBitmap bm;
bm.CreateBitmap(16, 16, 1, 32, NULL);
BITMAP bitmap;
bm.GetBitmap(&bitmap);
CBitmap *pOldBm = dc.SelectObject(&bm);
dc.FillSolidRect(0, 0, 16, 16, clrFill);

 // either
 img.BitBlt(dc.m_hDC, leftEdge, 0, SRCCOPY);
 // or
 img.Draw(dc.m_hDC, leftEdge, 0);

dc.SelectObject(pOldBm);
imagelist.Add(&bm, clrFill);

bus I suppose gdi+ has more to offer.

QuestionRegistering a 64 bit DLL from a 32 bit application Pin
Rajesh R Subramanian1-Mar-11 4:31
professionalRajesh R Subramanian1-Mar-11 4:31 
AnswerRe: Registering a 64 bit DLL from a 32 bit application Pin
Richard Andrew x641-Mar-11 7:59
professionalRichard Andrew x641-Mar-11 7:59 
GeneralRe: Registering a 64 bit DLL from a 32 bit application Pin
Rajesh R Subramanian1-Mar-11 8:36
professionalRajesh R Subramanian1-Mar-11 8:36 
AnswerRe: Registering a 64 bit DLL from a 32 bit application Pin
Rajesh R Subramanian1-Mar-11 23:18
professionalRajesh R Subramanian1-Mar-11 23:18 
QuestionHow to check if a string is base64 encoded string? Pin
rahul.kulshreshtha28-Feb-11 18:06
rahul.kulshreshtha28-Feb-11 18:06 
AnswerRe: How to check if a string is base64 encoded string? Pin
Cool_Dev28-Feb-11 18:29
Cool_Dev28-Feb-11 18:29 
GeneralRe: How to check if a string is base64 encoded string? Pin
rahul.kulshreshtha28-Feb-11 20:11
rahul.kulshreshtha28-Feb-11 20:11 
AnswerRe: How to check if a string is base64 encoded string? PinPopular
Hans Dietrich28-Feb-11 18:33
mentorHans Dietrich28-Feb-11 18:33 
GeneralRe: How to check if a string is base64 encoded string? Pin
rahul.kulshreshtha28-Feb-11 20:11
rahul.kulshreshtha28-Feb-11 20:11 
GeneralRe: How to check if a string is base64 encoded string? Pin
CPallini28-Feb-11 23:15
mveCPallini28-Feb-11 23:15 
QuestionGet Volume Name From Path Pin
Richard Andrew x6428-Feb-11 17:31
professionalRichard Andrew x6428-Feb-11 17:31 
AnswerRe: Get Volume Name From Path Pin
Richard Andrew x6428-Feb-11 17:44
professionalRichard Andrew x6428-Feb-11 17:44 
AnswerRe: Get Volume Name From Path Pin
Hans Dietrich28-Feb-11 17:44
mentorHans Dietrich28-Feb-11 17:44 
AnswerRe: Get Volume Name From Path Pin
Niklas L1-Mar-11 0:43
Niklas L1-Mar-11 0:43 
GeneralRe: Get Volume Name From Path Pin
Hans Dietrich1-Mar-11 1:23
mentorHans Dietrich1-Mar-11 1:23 
GeneralRe: Get Volume Name From Path Pin
Niklas L1-Mar-11 1:47
Niklas L1-Mar-11 1:47 
QuestionMFC command line in VC6.0 - repost Pin
Vaclav_28-Feb-11 4:07
Vaclav_28-Feb-11 4:07 

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.