FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
PrintDlg Question

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    The Ville.org Half-Life Gaming Community Forum Index -> Tech Corner
View previous topic :: View next topic  
Author Message
Potato-VS-
Registered User


Joined: 16 Jul 2002
Location: Ontario Canada
Posts: 1562

PostPosted: Sat Feb 08, 2003 8:38 am    Post subject: PrintDlg Question Reply with quote

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
View user's profile Send private message Send e-mail
Dahak
Registered User


Joined: 10 Feb 2002
Location: Rochester, NY and Windsor, CT
Posts: 923

PostPosted: Sat Feb 08, 2003 11:05 am    Post subject: Reply with quote

i'm assuming this is c++?
Back to top
View user's profile Send private message
Potato-VS-
Registered User


Joined: 16 Jul 2002
Location: Ontario Canada
Posts: 1562

PostPosted: Sat Feb 08, 2003 1:34 pm    Post subject: Reply with quote

Yea its C++ dahak.

orcblood
Back to top
View user's profile Send private message Send e-mail
OpTlk
Registered User


Joined: 27 Apr 2002
Location: San Diego, CA Guild:=US-V=
Posts: 2176

PostPosted: Sat Feb 08, 2003 2:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    The Ville.org Half-Life Gaming Community Forum Index -> Tech Corner All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group