Click here to Skip to main content
15,914,323 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Run Dll Pin
Jawache18-Sep-02 23:27
Jawache18-Sep-02 23:27 
GeneralRe: Run Dll Pin
Zizilamoroso18-Sep-02 23:43
Zizilamoroso18-Sep-02 23:43 
GeneralRe: Run Dll Pin
Jawache19-Sep-02 0:03
Jawache19-Sep-02 0:03 
GeneralRe: Run Dll Pin
Stephane Rodriguez.18-Sep-02 23:45
Stephane Rodriguez.18-Sep-02 23:45 
GeneralRe: Run Dll Pin
Zizilamoroso19-Sep-02 0:14
Zizilamoroso19-Sep-02 0:14 
GeneralRe: Run Dll Pin
Stephane Rodriguez.19-Sep-02 0:35
Stephane Rodriguez.19-Sep-02 0:35 
GeneralRe: Run Dll Pin
Zizilamoroso19-Sep-02 1:36
Zizilamoroso19-Sep-02 1:36 
QuestionWhy my code can't print the bitmap? Pin
wood18-Sep-02 22:03
wood18-Sep-02 22:03 
These are my codes about printing bitmap:
<br />
CDC  dc;<br />
	CPrintDialog printDlg(FALSE);<br />
	if (printDlg.DoModal() ==IDOK)<br />
	{<br />
		dc.Attach (printDlg.GetPrinterDC());<br />
		DOCINFO di;<br />
		memset(&di,0,sizeof(DOCINFO));<br />
		di.cbSize =sizeof(DOCINFO);<br />
		di.lpszDocName ="ͼÏó´òÓ¡";<br />
		CString filename="MONEY.bmp";<br />
     HBITMAP bmp=NULL;<br />
bmp=(HBITMAP)LoadImage(NULL,filename,IMAGE_BITMAP,0,0,LR_LOADFROMFILE|LR_CREATEDIBSECTION);<br />
<br />
	  CBitmap bitmap;<br />
	  bitmap.Attach (bmp);<br />
	  BOOL bPrintingOK = dc.StartDoc(&di);<br />
	CPrintInfo Info;<br />
    Info.m_rectDraw.SetRect(0,0, dc.GetDeviceCaps(HORZRES), dc.GetDeviceCaps(VERTRES));<br />
	StartPage(dc);<br />
<br />
	  <br />
      CDC dcMemory;<br />
      dcMemory.CreateCompatibleDC(&dc);<br />
	  		<br />
	  dcMemory.SelectObject(bmp);<br />
	  BITMAP bm;<br />
	  bitmap.GetBitmap(&bm);<br />
		<br />
dc.StretchBlt (0,0,bm.bmWidth,bm.bmHeight,&dcMemory,0,0,32,32,SRCCOPY);<br />
	  EndPage(dc);<br />
	  EndDoc(dc);<br />
	DeleteDC(dcMemory);<br />
   dc.Detach ();<br />
	}<br />
	DeleteDC(dc);<br />
<br />

The compiler told me there are 0 errors,but I can't see the bitmap appear on the paper after the program is executed.Why?Frown | :(
AnswerRe: Why my code can't print the bitmap? Pin
dabs19-Sep-02 1:46
dabs19-Sep-02 1:46 
GeneralCString Question Pin
Mazdak18-Sep-02 22:00
Mazdak18-Sep-02 22:00 
GeneralRe: CString Question Pin
Jon Hulatt18-Sep-02 22:17
Jon Hulatt18-Sep-02 22:17 
GeneralVC++ Timer Pin
Manjula_Madan18-Sep-02 20:47
sussManjula_Madan18-Sep-02 20:47 
GeneralRe: VC++ Timer Pin
NormDroid18-Sep-02 20:55
professionalNormDroid18-Sep-02 20:55 
QuestionDoc with tabbed view ? Pin
ranger18-Sep-02 20:43
ranger18-Sep-02 20:43 
AnswerRe: Doc with tabbed view ? Pin
jhwurmbach18-Sep-02 21:27
jhwurmbach18-Sep-02 21:27 
GeneralODBC Probelm Pin
SamirSood18-Sep-02 19:39
SamirSood18-Sep-02 19:39 
GeneralRe: ODBC Probelm Pin
jmkhael18-Sep-02 21:55
jmkhael18-Sep-02 21:55 
GeneralMemory Management in Microsoft Tree Control Pin
chepuri_uk18-Sep-02 19:32
chepuri_uk18-Sep-02 19:32 
Questionhow to? Pin
imran_rafique18-Sep-02 16:29
imran_rafique18-Sep-02 16:29 
AnswerRe: how to? Pin
Chris Losinger18-Sep-02 17:04
professionalChris Losinger18-Sep-02 17:04 
AnswerRe: how to? Pin
Nish Nishant18-Sep-02 18:46
sitebuilderNish Nishant18-Sep-02 18:46 
AnswerRe: how to? Pin
Pavel Klocek18-Sep-02 22:45
Pavel Klocek18-Sep-02 22:45 
Generaladding text to RichEdit box ! Pin
Hadi Rezaee18-Sep-02 16:12
Hadi Rezaee18-Sep-02 16:12 
GeneralRe: adding text to RichEdit box ! Pin
Stephane Rodriguez.18-Sep-02 20:49
Stephane Rodriguez.18-Sep-02 20:49 
QuestionFarsi language in VC++ .NET ? Pin
Hadi Rezaee18-Sep-02 15:50
Hadi Rezaee18-Sep-02 15:50 

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.