🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
7 messages
7 total messages Started by mattk Thu, 31 Aug 2006 19:34
setdefaultprinter
#3168
Author: mattk
Date: Thu, 31 Aug 2006 19:34
9 lines
1131 bytes
My program uses SetDefaultPrinter and SendMessageTimeout to switch between 
two printers.
This all seems to work.

The problem is I also have a TRichEdit component and I use the Print() 
method - but it does not
necessarily print to the default printer ....

How to solve such a problem? 
Re: setdefaultprinter
#3175
Author: Bob Gonder
Date: Fri, 01 Sep 2006 17:21
16 lines
1461 bytes
"mattk" <<none>> wrote:

>My program uses SetDefaultPrinter and SendMessageTimeout to switch between 
>two printers.

You should not be doing that.
It isn't very nice to mess with a user's windows settings.

>The problem is I also have a TRichEdit component and I use the Print() 
>method - but it does not necessarily print to the default printer ....
>
>How to solve such a problem? 

You should ask in vcl.components.using
They could also explain to you how to use the VCL to switch printers
so you don't have to make your customers mad at you.
Re: setdefaultprinter
#3176
Author: mattk
Date: Sun, 03 Sep 2006 03:29
28 lines
1824 bytes

you must assume the person has specific reasons for doing this - and nobody 
ever said anything about having customers ....




"Bob Gonder" <notbg@notmindspring.invalid> wrote in message 
news:5pqgf29jd13onp8q7kf9mt1fv15mm9uqh9@4ax.com...
> "mattk" <<none>> wrote:
>
>>My program uses SetDefaultPrinter and SendMessageTimeout to switch between
>>two printers.
>
> You should not be doing that.
> It isn't very nice to mess with a user's windows settings.
>
>>The problem is I also have a TRichEdit component and I use the Print()
>>method - but it does not necessarily print to the default printer ....
>>
>>How to solve such a problem?
>
> You should ask in vcl.components.using
> They could also explain to you how to use the VCL to switch printers
> so you don't have to make your customers mad at you.
>
> 
Re: setdefaultprinter
#3178
Author: Clayton Arends
Date: Sun, 03 Sep 2006 18:49
16 lines
1694 bytes
The first time the global VCL Printer object is referenced it will point to 
the system default printer.  If you change the system default printer then 
the printer object must be changed manually.  If you have control over the 
application then you can do something like the following:

  TPrinter* printer = Printer();
  int printerIndex = printer->Printers->IndexOf(theNewName);
  printer->PrinterIndex = printerIndex;

The exact way to get the new printerIndex might vary depending on the actual 
name you have.  But in any case you need to get the index some how.

As Bob mentioned, borland.public.cppbuilder.vcl.components.using would have 
been a better newsgroup to post this question.

- Clayton 
Re: setdefaultprinter
#3177
Author: Clayton Arends
Date: Sun, 03 Sep 2006 18:50
15 lines
1726 bytes
"mattk" <rain001@npcc.net> wrote in message 
news:44fa4c27@newsgroups.borland.com...
>
> you must assume the person has specific reasons for doing this -
> and nobody ever said anything about having customers ....

Part of the job of a responder in a newsgroup is to comment on an action 
that is typically problematic or demonstrates a lack of understanding of the 
issue.  It is never an assumption to believe that a "person has specific 
reasons" unless you explicitly mention that in the post (or a previous 
post).  Since you are the one asking for help it is up to you to provide the 
proper perception ... or you'll just have to deal with a perfectly valid 
response such as Bob's.

- Clayton
Re: setdefaultprinter
#3179
Author: Ed Mulroy
Date: Sun, 03 Sep 2006 18:59
10 lines
1416 bytes
Tell that to your other program running at the time and the one which will 
be run tomorrow, both which will now print on the wrong printer.

.  Ed

> mattk wrote in message
> news:44fa4c27@newsgroups.borland.com...
>
> you must assume the person has specific reasons for doing this - and 
> nobody ever said anything about having customers ....
Re: setdefaultprinter
#3180
Author: Clayton Arends
Date: Sun, 03 Sep 2006 19:28
10 lines
1262 bytes
"Clayton Arends" <nospam_claytonarends@hotmail.com> wrote in message 
news:44fb239f@newsgroups.borland.com...

> As Bob mentioned, borland.public.cppbuilder.vcl.components.using
> would have been a better newsgroup to post this question.

However, given that at the time you thought this might have been an OS issue 
this was a valid group as well.

- Clayton 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads