Go Back   TX Text Control Community > TX Text Control Discussion and Support Forums > TX Text Control ActiveX

TX Text Control ActiveX Please use this forum for TX Text Control ActiveX support only. If you need support for a different product, please use the appropriate forum.

Reply
 
Thread Tools Display Modes
  #1  
Old January 28, 2010
oskaremil oskaremil is offline
Registered User
 
Join Date: Nov 2008
Posts: 22
Exclamation Error when printing in Remote Desktop

TextControl version: ActiveX v14 SP3
Used in: PowerBuilder 11
Operating Systems: 64-bit Windows 7, 32-bit Windows Server 2008

I have this strange problem when printing from a remote desktop session.

First of all, printers (and drivers) are correctly installed. When I log on to the computer locally I have two printers, a Xerox WorkCentre PRO C3545, a network printer, and CutePDF printer, it prints to a PDF document. I do not have any problems printing to these printers from any other applications. When I log on to the same computer using same username via Remote Desktop, the two of them still works fine in other applications. In addition I also have a Xerox WorkCentre PRO C3545(redirected) printer in the session, that's the same physical printer installed locally on the remote computer I am connecting from. That works fine too.

That said, our application needs to print a TextControl document. We use the WIN32 API to display a Print Dialog (PrintDlg) and fetch selected printer and other user options. Printer is set with TextControl.PrintDevice property and print is triggered with TextControl.PrintDoc(...).

When I do this locally everything works fine, our TextControl powered applications can print all documents to said printers without problems. The error occurs when I log on to the same computer via remote desktop. When trying to print a document I get an error. These messages are fetched from the exception message:
Result Code: 65535
Exception Code: 65535
Source: Component provided no error information messate
Description: Component died; exception caught by PowerBuilder


Here is the code I use for printing:
Code:
lnv_printing = CREATE n_cst_printing
lnv_printerArgs.ToPage = myTextControl.CurrentPages
lnv_printerArgs.MaxPage = myTextControl.CurrentPages

IF (lnv_printing.pof_printdlg(ref lnv_printerArgs) = 1) THEN
	//Set print device
        //This goes fine:
	myTextControl.PrintDevice = lnv_printerArgs.hDeviceContext
	//Print document
        //This is where TextControl component dies:
	myTextControl.PrintDoc( &
		inv_DocAttrib.istr_fields.Title, &
		lnv_printerArgs.FromPage, &
		lnv_printerArgs.ToPage, &
		lnv_printerArgs.Copies)	
END IF
I have double checked lnv_printing and lnv_printerArgs prior to print, they are both valid objects.

Please help
Reply With Quote
  #2  
Old January 28, 2010
Gunnar Giffey's Avatar
Gunnar Giffey Gunnar Giffey is offline
TX Support Engineer
TX Text Control
 
Join Date: Sep 2004
Location: Bremen, Germany
Posts: 3,999
Re: Error when printing in Remote Desktop

Hello there,

I fully understand the trouble you are in, but PowerBuilder is officially not supported by TX Text Control, so I am unable to reproduce the issue, sorry.
Anyway, TX Text Control requires a locally connected printer to be able to render text in the device's contect and uses Windows' API to access the printer/printer driver. I am not sure how Remote Desktop simulates the printers in that context.
__________________
Regards,
Gunnar Giffey, TX Text Control
[Forum Administrator]
Reply With Quote
  #3  
Old January 28, 2010
Reallyethical's Avatar
Reallyethical Reallyethical is offline
TX Text Control MVP
 
Join Date: Sep 2008
Location: Derby, England
Posts: 230
Send a message via Skype™ to Reallyethical
Re: Error when printing in Remote Desktop

I am no expert on power builder, but I am not sure it has elevated privileges to get the printer base.

Have you ensured that the permissions on the printer allow all authenticated users all permissions ?

Remember you are seen as a Remote Instance User not a local user in the newer RDC versions.

Regards

Adam
Reply With Quote
  #4  
Old January 28, 2010
oskaremil oskaremil is offline
Registered User
 
Join Date: Nov 2008
Posts: 22
Re: Error when printing in Remote Desktop

Quote:
Originally Posted by Reallyethical View Post
I am no expert on power builder, but I am not sure it has elevated privileges to get the printer base.

Have you ensured that the permissions on the printer allow all authenticated users all permissions ?

Remember you are seen as a Remote Instance User not a local user in the newer RDC versions.

Regards

Adam
Yes, I am pretty sure as I have no problems printing from other applications.
Reply With Quote
  #5  
Old January 28, 2010
oskaremil oskaremil is offline
Registered User
 
Join Date: Nov 2008
Posts: 22
Re: Error when printing in Remote Desktop

Quote:
Originally Posted by Gunnar Giffey View Post
Hello there,

I fully understand the trouble you are in, but PowerBuilder is officially not supported by TX Text Control, so I am unable to reproduce the issue, sorry.
Anyway, TX Text Control requires a locally connected printer to be able to render text in the device's contect and uses Windows' API to access the printer/printer driver. I am not sure how Remote Desktop simulates the printers in that context.
We are using the TextControl as an OLE Custom Control, pretty much the same way as VB does it. Would it help if i crammed together a little VB app to help you reproduce the context ?
Reply With Quote
  #6  
Old January 28, 2010
oskaremil oskaremil is offline
Registered User
 
Join Date: Nov 2008
Posts: 22
Re: Error when printing in Remote Desktop

Quote:
To avoid restoring the original document the print preparation (populating some headers etc..) was done by copying the contents of the TextControl to a new TextControl to handle the print (myTextControl from the code samples). I rewrote the code to save a backup to bytestream, do print preparations in the primary TextControl and restore from bytestream after printing.

Now printing works in Remote Desktop environment too, even using the same codelines to do the actual print job. I must say, it was quite a curiosity, that the error thrown by the secondary only appeared when loggin in via Remote Desktop
Curses... problem still not solved. I got it to work for about two days, then my previously working code stopped working even though I did no changes there. I'll do a VB example and set to you

Last edited by oskaremil; February 1, 2010 at 14:59:14. Reason: Problem still not solved.
Reply With Quote
  #7  
Old January 29, 2010
Gunnar Giffey's Avatar
Gunnar Giffey Gunnar Giffey is offline
TX Support Engineer
TX Text Control
 
Join Date: Sep 2004
Location: Bremen, Germany
Posts: 3,999
Re: Error when printing in Remote Desktop [SOLVED]

Is that secondary TextControl visible and on a form?
If not, that is probably the source of the error.
__________________
Regards,
Gunnar Giffey, TX Text Control
[Forum Administrator]
Reply With Quote
  #8  
Old February 1, 2010
oskaremil oskaremil is offline
Registered User
 
Join Date: Nov 2008
Posts: 22
Re: Error when printing in Remote Desktop [SOLVED]

Quote:
Originally Posted by Gunnar Giffey View Post
Is that secondary TextControl visible and on a form?
If not, that is probably the source of the error.
That secondary TextControl was on a form, but invisible. That could have been the problem.

The primary TextControl, which I am now having troubles with is visible and on a form.
Reply With Quote
  #9  
Old February 2, 2010
oskaremil oskaremil is offline
Registered User
 
Join Date: Nov 2008
Posts: 22
Re: Error when printing in Remote Desktop

Please see attached files (printertest.zip). This is a VB6 form where I reproduced the same error.


When the application is run by a user logged on locally print is OK.

When the application is run by a user logged on via Remote Desktop it fails with the attached error message (printertest.png)
Attached Images
File Type: png printertest.PNG (7.5 KB, 37 views)
Attached Files
File Type: zip printertest.zip (5.2 KB, 27 views)
Reply With Quote
  #10  
Old March 11, 2010
Gunnar Giffey's Avatar
Gunnar Giffey Gunnar Giffey is offline
TX Support Engineer
TX Text Control
 
Join Date: Sep 2004
Location: Bremen, Germany
Posts: 3,999
Re: Error when printing in Remote Desktop

Hello Oskar,
The issue here is not a bug in TX Text Control, but a general error message from the system.
Remote Desktop printing has not been tested with TX Text Control, and I guess that the error comes from the emulated printer driver.
TX Text Control requires a valid printer driver to be able to render text in the device context. This seems not to be the case here.
__________________
Regards,
Gunnar Giffey, TX Text Control
[Forum Administrator]
Reply With Quote
  #11  
Old March 11, 2010
oskaremil oskaremil is offline
Registered User
 
Join Date: Nov 2008
Posts: 22
Angry Re: Error when printing in Remote Desktop

I have a valid printer driver. Even three of them !

Every other application can print to any of the three printers in Remote Desktop.

The application using TextControl also utilizes Crystal Reports print routines and native print routines for other print jobs. So out of a hundred possible places I can print from there is one thing that fails: Printing from a TextControl component.
Reply With Quote
  #12  
Old March 11, 2010
oskaremil oskaremil is offline
Registered User
 
Join Date: Nov 2008
Posts: 22
Angry Re: Error when printing in Remote Desktop

You even stated that TextControl printing in Remote Desktop isn't tested ? How can you guess that this is a system error when everything else works fine ?
Reply With Quote
  #13  
Old March 11, 2010
Gunnar Giffey's Avatar
Gunnar Giffey Gunnar Giffey is offline
TX Support Engineer
TX Text Control
 
Join Date: Sep 2004
Location: Bremen, Germany
Posts: 3,999
Re: Error when printing in Remote Desktop

Oskar,
Could you please find out how long the printer's name is, that you want to print on?
Thank you.
__________________
Regards,
Gunnar Giffey, TX Text Control
[Forum Administrator]
Reply With Quote
  #14  
Old March 12, 2010
oskaremil oskaremil is offline
Registered User
 
Join Date: Nov 2008
Posts: 22
Re: Error when printing in Remote Desktop

These are the printer device names. Neither works when printing in remote desktop.

\\http://10.0.8.20\WCP3545
CutePDF Writer
Microsoft XPS Document Writer
Reply With Quote
  #15  
Old March 12, 2010
Gunnar Giffey's Avatar
Gunnar Giffey Gunnar Giffey is offline
TX Support Engineer
TX Text Control
 
Join Date: Sep 2004
Location: Bremen, Germany
Posts: 3,999
Re: Error when printing in Remote Desktop

Thank you for your reply.
Could you please test that also with the latest service pack for version 14?
Do you get the same result?
__________________
Regards,
Gunnar Giffey, TX Text Control
[Forum Administrator]
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Printing control - duplex, paper source, number of copies, etc. jbrown TX Text Control ActiveX 0 May 5, 2009 06:21:49
Problem with Printing Unregistered TX Text Control .NET 2 September 15, 2004 22:21:30
Printing Images to Metafile jms3 TX Text Control ActiveX 0 January 6, 2004 16:36:26
Printing to trays paco36 TX Text Control ActiveX 0 February 25, 2003 15:59:37
header lines missing by printing Unregistered TX Text Control ActiveX 3 October 15, 2002 21:01:04


All times are GMT +1. The time now is 06:17:55.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© 1991 - 2010 The Imaging Source Europe GmbH