| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| Potato-VS- Registered User
 
 
 Joined: 16 Jul 2002
 Location: Ontario Canada
 Posts: 1562
 
 | 
			
				|  Posted: Sat Feb 08, 2003 8:38 am    Post subject: PrintDlg Question |   |  
				| 
 |  
				| Okay, I made a program like notepad and I have some of the menu items working (Exit and print to be specfic).  But I have a small problem with the printing dialog.  It won't pring the document!  It only prints a certain word that i place into the DOCINFO programming.  So for example: it would print "printer" if I placed that into the text line.  (see the code below for the full doc info coding).  I know that I would probably have to create a variable for the text area of the program, but I don't know how to do this properly - it gives me errors when I try to use the variable for the edit box that I made. 
 Anyways, heres the code for the DOCINFO:
 
 DOCINFO di;
 di.cbSize = sizeof(DOCINFO);
 di.lpszDocName = "Bitmap Printing Text";
 di.lpszOutput = (LPTSTR)NULL;
 di.fwType = 0;
 StartDoc(pd.hDC, &di);
 StartPage(pd.hDC);
 TextOut(pd.hDC, 20, 20, "Print", lstrlen("Print"));
 EndPage(pd.hDC);
 EndDoc(pd.hDC);
 DeleteDC(pd.hDC);
 
 Line 8 is where the problem is, however I don't know how to fix this so that it prints the entire document.  If anyone requires the full sourcecode then please say so.
 
 Thanks,
 [RS]Potato-VS-
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Dahak Registered User
 
 
 Joined: 10 Feb 2002
 Location: Rochester, NY and Windsor, CT
 Posts: 923
 
 | 
			
				|  Posted: Sat Feb 08, 2003 11:05 am    Post subject: |   |  
				| 
 |  
				| i'm assuming this is c++? |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| Potato-VS- Registered User
 
 
 Joined: 16 Jul 2002
 Location: Ontario Canada
 Posts: 1562
 
 | 
			
				|  Posted: Sat Feb 08, 2003 1:34 pm    Post subject: |   |  
				| 
 |  
				| Yea its C++ dahak. 
 orcblood
  |  | 
	
		| Back to top |  | 
	
		|  | 
	
		| OpTlk Registered User
 
  
 Joined: 27 Apr 2002
 Location: San Diego,   CA        Guild:=US-V=
 Posts: 2176
 
 | 
			
				|  Posted: Sat Feb 08, 2003 2:25 pm    Post subject: |   |  
				| 
 |  
				| I think the first Print is causing the trouble...its looking for a string to Print and you put Print in quotes so its now your string.  I very well could be wrong though...its been awhile since C++. check it against this as an example. 
 TextOut(hdc, 1, 1, str, strlen(str));
 
 hopefully someone else can either back this up or give you better advice. good luck
 _________________
 
   http://www.myspace.com/pvallone
 |  | 
	
		| Back to top |  | 
	
		|  | 
	
		|  |