 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Roxanne Guest
|
Posted: Thu May 12, 2005 12:44 pm Post subject: Printing in a sercice : TPrinter |
|
|
Hello,
My application (= a service) has to generate a simple document (text)
on a printer.
I have try the following :
TPrinter *pPrinter = Printer();
if ( pPrinter != NULL )
{
pPrinter->BeginDoc();
pPrinter->Canvas->Font->Name = "Courrier New";
pPrinter->Canvas->Font->Size = 12;
pPrinter->Canvas->TextOut(150, 150, "My text to write");
pPrinter->EndDoc();
}
It works with a debug view but without view in my real application it blocks
on BeginDoc.
I have to make it work in a service (with no view)
How can I do that ?
I am working with C++ Builder 6 on Windows.
Thanks for any help
Roxanne
|
|
| Back to top |
|
 |
Joseph F. Muscarella Guest
|
Posted: Fri May 13, 2005 2:12 pm Post subject: Re: Printing in a sercice : TPrinter |
|
|
I have similar code in one of my services that works ok (with Builder 5).
However, just prior to the call to BeginDoc() I set the Title property. I
have found that failure to set the title or setting after BeginDoc() causes
problems.
pPrinter->Title = "Some Title";
pPrinter->BeginDoc();
Joe
"Roxanne" <roxanne (AT) softek (DOT) fr> wrote
| Quote: | Hello,
My application (= a service) has to generate a simple document (text)
on a printer.
I have try the following :
TPrinter *pPrinter = Printer();
if ( pPrinter != NULL )
{
pPrinter->BeginDoc();
pPrinter->Canvas->Font->Name = "Courrier New";
pPrinter->Canvas->Font->Size = 12;
pPrinter->Canvas->TextOut(150, 150, "My text to write");
pPrinter->EndDoc();
}
It works with a debug view but without view in my real application it
blocks
on BeginDoc.
I have to make it work in a service (with no view)
How can I do that ?
I am working with C Builder 6 on Windows.
Thanks for any help
Roxanne
|
|
|
| Back to top |
|
 |
Roxanne Guest
|
Posted: Mon May 16, 2005 1:43 pm Post subject: Re: Printing in a sercice : TPrinter |
|
|
Thanks for this answer.
I set the title and correct some access rights problem too.
After several modifications it works !
Roxanne
"Joseph F. Muscarella" <joe (AT) infosight-DISCARDMUNG- (DOT) com> a écrit dans le
message de news: 4284b5a4$1 (AT) newsgroups (DOT) borland.com...
| Quote: | I have similar code in one of my services that works ok (with Builder 5).
However, just prior to the call to BeginDoc() I set the Title property.
I
have found that failure to set the title or setting after BeginDoc()
causes
problems.
pPrinter->Title = "Some Title";
pPrinter->BeginDoc();
Joe
"Roxanne" <roxanne (AT) softek (DOT) fr> wrote in message
news:42834fac (AT) newsgroups (DOT) borland.com...
Hello,
My application (= a service) has to generate a simple document (text)
on a printer.
I have try the following :
TPrinter *pPrinter = Printer();
if ( pPrinter != NULL )
{
pPrinter->BeginDoc();
pPrinter->Canvas->Font->Name = "Courrier New";
pPrinter->Canvas->Font->Size = 12;
pPrinter->Canvas->TextOut(150, 150, "My text to write");
pPrinter->EndDoc();
}
It works with a debug view but without view in my real application it
blocks
on BeginDoc.
I have to make it work in a service (with no view)
How can I do that ?
I am working with C Builder 6 on Windows.
Thanks for any help
Roxanne
|
|
|
| Back to top |
|
 |
|
|
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
|
|