🚀 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 Mike Snyder Fri, 07 Jul 2006 16:58
C++ Builder 6 printer name limitation
#3378
Author: Mike Snyder
Date: Fri, 07 Jul 2006 16:58
14 lines
1594 bytes
Hi there,

    We're having a problem with some applications built with C++ Builder 6.
Apparently, whenever the printer name exceeds 80 characters, certain error
messages appear making it impossible to print to that printer.  Namely -
"there is no default printer selected."  The following link confirms the
problem (in the reply added below), but I have found nothing to suggest a
workaround or fix for this.

http://community.borland.com/article/0,1410,17386,00.html

I'm not sure exactly where to post this, so if anyone could point me to a
more applicable newsgroup that would also be appreciated.  If there's a fix
available that would be the first choice though.  Thanks.
Re: C++ Builder 6 printer name limitation
#3380
Author: Clayton Arends
Date: Sat, 08 Jul 2006 05:44
16 lines
1280 bytes
When are you having the problem?  I created the following test:

1. Renamed one of my printers to a name with 100 characters.
2. Created a new app and added the following code to a button handler:

  PrintDialog1->Execute();
  Printer()->BeginDoc();
  Printer()->Canvas->DrawFocusRect(TRect(0, 0, 45, 45));
  Printer()->EndDoc();

The print worked as expected.

WinXP SP2
BCB6 Update 4

- Clayton 
Re: C++ Builder 6 printer name limitation
#3383
Author: JD
Date: Sat, 08 Jul 2006 17:38
11 lines
1141 bytes
"Mike Snyder" <snyderm7@hotmail.com> wrote:
>

I can confirm Clayton's test.

As a note, I had a similar problem many years ago when I
incorrectly assumed a max length for the printer name which
was resolved by using an AnsiString instead of a char array.

~ JD
Re: C++ Builder 6 printer name limitation
#3288
Author: Mike Snyder
Date: Mon, 10 Jul 2006 18:52
28 lines
1781 bytes
Yes,

    When the printing is run under XP it works fine with a long printer name
(i.e. 80+ characters).  When using Windows 2000 though, it fails after 80
characters.  Kind of strange.  But confirmed without any update as to how it
can be fixed.


"Clayton Arends" <nospam_claytonarends@hotmail.com> wrote in message
news:44af463a@newsgroups.borland.com...
> When are you having the problem?  I created the following test:
>
> 1. Renamed one of my printers to a name with 100 characters.
> 2. Created a new app and added the following code to a button handler:
>
>   PrintDialog1->Execute();
>   Printer()->BeginDoc();
>   Printer()->Canvas->DrawFocusRect(TRect(0, 0, 45, 45));
>   Printer()->EndDoc();
>
> The print worked as expected.
>
> WinXP SP2
> BCB6 Update 4
>
> - Clayton
>
>
Re: C++ Builder 6 printer name limitation
#3289
Author: Clayton Arends
Date: Mon, 10 Jul 2006 22:52
5 lines
1241 bytes
I tried the same test application that I provided before on one of my 
company's Win2K servers and had no problem.  Sorry, but you're going to have 
to provide more information or a better test case for me to duplicate.

- Clayton 
Re: C++ Builder 6 printer name limitation
#3292
Author: Mike Snyder
Date: Tue, 11 Jul 2006 17:36
13 lines
1512 bytes
We're actually using TPrinter, rather than Printer.  What happens when you
use that?  Thanks for the help.

"Clayton Arends" <nospam_claytonarends@hotmail.com> wrote in message
news:44b2da29$1@newsgroups.borland.com...
> I tried the same test application that I provided before on one of my
> company's Win2K servers and had no problem.  Sorry, but you're going to
have
> to provide more information or a better test case for me to duplicate.
>
> - Clayton
>
>
Re: C++ Builder 6 printer name limitation
#3297
Author: Clayton Arends
Date: Tue, 11 Jul 2006 23:59
4 lines
1152 bytes
The Printer() function returns the global TPrinter instance.  Check the help 
on it for more details.

- 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