Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing problem

Status
Not open for further replies.

Baal80

Programmer
Aug 14, 2004
14
PL
Hi,

I just want to print a text contained in a TMemo object. When I execute the following code:

MyMemo->Print("*** TITLE ***");

an error occurs stating that "There is no default printer currently selected" despite the fact that I HAVE a default printer selected in Control Panel->Printers.

What is the problem? Can you help me?
Thanks.
 
Have you told your program the handle of the default printer?


James P. Cottingham
-----------------------------------------
To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.
 
No, I haven't. In fact, I've merely rewritten the example of Print() function from the Builder's help. Can you tell me how to create the handle you talk about?
 
The easiest way is to put a TPrintDialog component on the form. Another way is to use the SetPrinter and Printer functions of the Printer.hpp file.

I must admit, I've never had to use the Windows printer in one of my programs. Post here again after you looked up the help information on the dialog and printer functions. I have some books I can look info up in.

James P. Cottingham
-----------------------------------------
To determine how long it will take to write and debug a program, take your best estimate, multiply that by two, add one, and convert to the next higher units.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top