Click here to Skip to main content
15,902,938 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: file list in mfc Pin
Pandele Florin23-Jun-06 5:27
Pandele Florin23-Jun-06 5:27 
AnswerRe: file list in mfc Pin
ftsOne23-Jun-06 7:28
ftsOne23-Jun-06 7:28 
QuestionUnicode support Pin
eusto23-Jun-06 0:13
eusto23-Jun-06 0:13 
AnswerRe: Unicode support Pin
Ștefan-Mihai MOGA23-Jun-06 2:17
professionalȘtefan-Mihai MOGA23-Jun-06 2:17 
AnswerRe: Unicode support Pin
David Crow23-Jun-06 2:56
David Crow23-Jun-06 2:56 
AnswerRe: Unicode support Pin
Pandele Florin23-Jun-06 5:09
Pandele Florin23-Jun-06 5:09 
GeneralRe: Unicode support Pin
eusto23-Jun-06 15:00
eusto23-Jun-06 15:00 
QuestionInserting HBitmap object in CRichEditCtrl Pin
Farhat Aisha23-Jun-06 0:12
Farhat Aisha23-Jun-06 0:12 
Hi,
I want to insert a HBitmap object in the CRichEditCtrl. For this purpose I am using the CImageDataObject class (defined by the following open-source project)
http://www.codeguru.com/cpp/controls/richedit/article.php/c5383/[^]
My problem is that it works fine if I use the bitmaps which are loaded from resources. but gives a Memory exception if I create my own bitmap.
My bitmap creation function is given as follows

HBITMAP MyImage::MakeBitmap2()
{
if (!pDib)
return NULL;
HBITMAP handle = NULL;
HDC dc = ::CreateCompatibleDC(NULL);
if (dc)
{
// tmpBitmap is a dummy, to satisfy ::CreateCompatibleDC (it
// is a memory dc that must have a handle selected into it)
BITMAPINFO bi;
ZeroMemory(&bi, sizeof bi);
bi.bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
bi.bmiHeader.biWidth = GetWidth();
bi.bmiHeader.biHeight = GetHeight();
bi.bmiHeader.biPlanes = 1;
bi.bmiHeader.biBitCount = 24;

VOID* pvBits;
handle =CreateDIBSection(dc, &bi, DIB_RGB_COLORS, &pvBits, NULL, 0);
if (handle==NULL)
{
return NULL;
}
HBITMAP oldBitmap = (HBITMAP) ::SelectObject(dc, handle);
StretchDIBits(dc, 0, 0, head.biWidth, head.biHeight, 0, 0, head.biWidth, head.biHeight,
info.pImage,(BITMAPINFO*)pDib, DIB_RGB_COLORS,SRCCOPY);
::SelectPalette(dc, NULL, TRUE);
::SelectObject(dc, oldBitmap);
::DeleteDC(dc);

}
return handle;
}
I am already using this function for doing some other image related tasks and it is working fine,
So can any body tell me why isn't it working with that object.
AnswerRe: Inserting HBitmap object in CRichEditCtrl Pin
Hamid_RT23-Jun-06 0:25
Hamid_RT23-Jun-06 0:25 
QuestionProblem in WH_CBT hook [modified] Pin
Javagal Srinath23-Jun-06 0:03
Javagal Srinath23-Jun-06 0:03 
AnswerRe: Problem in WH_CBT hook Pin
ROWALI23-Jun-06 1:33
ROWALI23-Jun-06 1:33 
QuestionQuestion in basic C++ Pin
LordsAngel22-Jun-06 23:55
LordsAngel22-Jun-06 23:55 
AnswerRe: Question in basic C++ Pin
Cedric Moonen23-Jun-06 0:03
Cedric Moonen23-Jun-06 0:03 
GeneralRe: Question in basic C++ [modified] Pin
Stephen Hewitt23-Jun-06 1:05
Stephen Hewitt23-Jun-06 1:05 
GeneralRe: Question in basic C++ Pin
Emilio Garavaglia23-Jun-06 1:10
Emilio Garavaglia23-Jun-06 1:10 
AnswerRe: Question in basic C++ Pin
Javagal Srinath23-Jun-06 0:16
Javagal Srinath23-Jun-06 0:16 
General[deleted] Pin
toxcct23-Jun-06 0:23
toxcct23-Jun-06 0:23 
GeneralRe: Question in basic C++ Pin
Javagal Srinath23-Jun-06 0:32
Javagal Srinath23-Jun-06 0:32 
General[Message Deleted] Pin
toxcct23-Jun-06 0:37
toxcct23-Jun-06 0:37 
GeneralRe: Question in basic C++ Pin
Javagal Srinath23-Jun-06 1:06
Javagal Srinath23-Jun-06 1:06 
GeneralRe: Question in basic C++ Pin
Stephen Hewitt23-Jun-06 1:14
Stephen Hewitt23-Jun-06 1:14 
GeneralRe: Question in basic C++ Pin
Nish Nishant23-Jun-06 4:50
sitebuilderNish Nishant23-Jun-06 4:50 
AnswerRe: Question in basic C++ Pin
Maximilien23-Jun-06 2:12
Maximilien23-Jun-06 2:12 
GeneralRe: Question in basic C++ Pin
Cedric Moonen23-Jun-06 3:01
Cedric Moonen23-Jun-06 3:01 
AnswerRe: Question in basic C++ Pin
Gary R. Wheeler23-Jun-06 14:58
Gary R. Wheeler23-Jun-06 14:58 

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.