BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Printing in a sercice : TPrinter

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Roxanne
Guest





PostPosted: Thu May 12, 2005 12:44 pm    Post subject: Printing in a sercice : TPrinter Reply with 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
Joseph F. Muscarella
Guest





PostPosted: Fri May 13, 2005 2:12 pm    Post subject: Re: Printing in a sercice : TPrinter Reply with 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

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





PostPosted: Mon May 16, 2005 1:43 pm    Post subject: Re: Printing in a sercice : TPrinter Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
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, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.