Click here to Skip to main content
15,791,050 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CFileDialog OnTypeChange issue Pin
_Flaviu4-Oct-15 22:29
_Flaviu4-Oct-15 22:29 
QuestionA c program to project expected number of rabbits on a farm Pin
Arnold Mukisa29-Sep-15 9:27
Arnold Mukisa29-Sep-15 9:27 
AnswerRe: A c program to project expected number of rabbits on a farm Pin
Arnold Mukisa29-Sep-15 9:30
Arnold Mukisa29-Sep-15 9:30 
SuggestionRe: A c program to project expected number of rabbits on a farm Pin
David Crow29-Sep-15 16:42
David Crow29-Sep-15 16:42 
GeneralRe: A c program to project expected number of rabbits on a farm Pin
David Crow29-Sep-15 16:34
David Crow29-Sep-15 16:34 
QuestionRe: A c program to project expected number of rabbits on a farm Pin
Paul Conrad1-Oct-15 8:33
professionalPaul Conrad1-Oct-15 8:33 
GeneralRe: A c program to project expected number of rabbits on a farm Pin
David Crow1-Oct-15 11:19
David Crow1-Oct-15 11:19 
Question0 bytes CImage saved Pin
_Flaviu29-Sep-15 0:47
_Flaviu29-Sep-15 0:47 
I intend to save CBitmap into a bmp file, here is the code:
C++
// MyDocument.cpp
			CMyView* pView = (CMyView*)GetNextView(pos);
			CDC* pDC = pView->GetDC();

			CDC MemDC;
			MemDC.CreateCompatibleDC(pDC);

			CBitmap bitmap;
			bitmap.CreateCompatibleBitmap(pDC, GetTotalCx(), GetTotalCy());
			CBitmap* pOldBitmap = (CBitmap*)MemDC.SelectObject(&bitmap);
			// draw the MemDC
			pDC->BitBlt(0, 0, GetTotalCx(), GetTotalCy(), &MemDC, 0, 0, SRCCOPY);
			CBitmap* pFinalBitmap = (CBitmap*)MemDC.SelectObject(pOldBitmap);
			CImage Image;
			Image.Attach((HBITMAP)pFinalBitmap->m_hObject);
			Image.Save(ar.GetFile()->GetFileName(), Gdiplus::ImageFormatBMP);
			bitmap.DeleteObject();

but the resulting bitmap file has 0 bytes ... why ? Could you help me ?
QuestionRe: 0 bytes CImage saved Pin
CPallini29-Sep-15 1:02
mveCPallini29-Sep-15 1:02 
AnswerRe: 0 bytes CImage saved Pin
_Flaviu29-Sep-15 1:06
_Flaviu29-Sep-15 1:06 
AnswerRe: 0 bytes CImage saved Pin
_Flaviu29-Sep-15 1:33
_Flaviu29-Sep-15 1:33 
SuggestionRe: 0 bytes CImage saved Pin
Jochen Arndt29-Sep-15 1:36
professionalJochen Arndt29-Sep-15 1:36 
GeneralRe: 0 bytes CImage saved Pin
_Flaviu29-Sep-15 1:57
_Flaviu29-Sep-15 1:57 
GeneralRe: 0 bytes CImage saved Pin
Jochen Arndt29-Sep-15 1:59
professionalJochen Arndt29-Sep-15 1:59 
GeneralRe: 0 bytes CImage saved Pin
_Flaviu29-Sep-15 2:00
_Flaviu29-Sep-15 2:00 
QuestionHow to drag a node from treeview to listbox in MFC. What is the event ? Pin
Member 1199023524-Sep-15 17:50
Member 1199023524-Sep-15 17:50 
AnswerRe: How to drag a node from treeview to listbox in MFC. What is the event ? Pin
Jochen Arndt24-Sep-15 23:13
professionalJochen Arndt24-Sep-15 23:13 
Questionhelp Pin
robsons200724-Sep-15 17:01
robsons200724-Sep-15 17:01 
AnswerRe: help Pin
robsons200724-Sep-15 17:05
robsons200724-Sep-15 17:05 
AnswerRe: help Pin
robsons200724-Sep-15 17:06
robsons200724-Sep-15 17:06 
GeneralRe: help Pin
Richard MacCutchan24-Sep-15 23:35
mveRichard MacCutchan24-Sep-15 23:35 
GeneralRe: help Pin
robsons200725-Sep-15 13:02
robsons200725-Sep-15 13:02 
GeneralRe: help Pin
Richard MacCutchan25-Sep-15 23:09
mveRichard MacCutchan25-Sep-15 23:09 
AnswerRe: help Pin
Jochen Arndt24-Sep-15 23:30
professionalJochen Arndt24-Sep-15 23:30 
GeneralRe: help Pin
robsons200725-Sep-15 11:47
robsons200725-Sep-15 11:47 

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.