Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #4502 > unrolled thread
| Started by | igsofterror@gmail.com |
|---|---|
| First post | 2012-12-20 09:41 -0800 |
| Last post | 2013-02-05 11:11 -0800 |
| Articles | 7 — 5 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
GetPrinters - Terminal server igsofterror@gmail.com - 2012-12-20 09:41 -0800
Re: GetPrinters - Terminal server Jean-Luc Stassen <igsoftsprl.be@gmail.com> - 2013-01-09 03:23 -0800
Re: GetPrinters - Terminal server dlzc <dlzc1@cox.net> - 2013-01-09 05:52 -0800
Re: GetPrinters - Terminal server "Jamal" <vodotnet_nospam@yahoo.com> - 2013-01-09 17:38 -0500
Re: GetPrinters - Terminal server Jean-Luc Stassen <jls@igsoft.be> - 2013-02-02 06:58 -0800
Re: GetPrinters - Terminal server dlzc <dlzc1@cox.net> - 2013-02-02 09:52 -0800
Re: GetPrinters - Terminal server Jean-Luc Stassen <jls@igsoft.be> - 2013-02-05 11:11 -0800
| From | igsofterror@gmail.com |
|---|---|
| Date | 2012-12-20 09:41 -0800 |
| Subject | GetPrinters - Terminal server |
| Message-ID | <b24262bb-af21-4cf8-a09f-bcf293f06f72@googlegroups.com> |
Hello all, On a terminal server, GetPrinters retrieve all the installed printer on the server... even the printer currectly conntected by other users ! I need the same list of printer that the list avaiable with ShowPrintDlg How can I get this list ? I need that because I have to deal with (redirected xx) that is appended at the end of the printer name, and if I want to save a current printer, I have to remove that... and then, at the next session find the new redirected printer Jean-Luc
[toc] | [next] | [standalone]
| From | Jean-Luc Stassen <igsoftsprl.be@gmail.com> |
|---|---|
| Date | 2013-01-09 03:23 -0800 |
| Message-ID | <206e4faa-e6dd-48c3-8a4c-3ad6431ed2f3@googlegroups.com> |
| In reply to | #4502 |
No answer ? No one has this kind of trouble with easyprint terminal printer ? So how to record in my app an easyprint printer to get it back with a new session... Jean-Luc
[toc] | [prev] | [next] | [standalone]
| From | dlzc <dlzc1@cox.net> |
|---|---|
| Date | 2013-01-09 05:52 -0800 |
| Message-ID | <64aeef3c-f6fe-475a-8dab-87265d1ff535@googlegroups.com> |
| In reply to | #4565 |
Dear Jean-Luc Stassen: On Wednesday, January 9, 2013 4:23:57 AM UTC-7, Jean-Luc Stassen wrote: ... > No answer ? I cannot help, sorry. > No one has this kind of trouble with easyprint > terminal printer ? I don't use terminal services. > So how to record in my app an easyprint printer > to get it back with a new session... Apparently this information is stored in the registry for your session: http://stackoverflow.com/questions/676616/enumerate-printers-for-a-specific-terminal-server-session This may or may not help, and translation will be required... David A. Smith
[toc] | [prev] | [next] | [standalone]
| From | "Jamal" <vodotnet_nospam@yahoo.com> |
|---|---|
| Date | 2013-01-09 17:38 -0500 |
| Message-ID | <kckrhd$55r$1@dont-email.me> |
| In reply to | #4502 |
Jean-Luc, If understand you correctly, you ONLY want to get the printers for the current user session. If so, see the following discussion: http://www.geekpedia.com/Thread27671_How-To-Get-Printer-Names-In-Terminal-Services-Session.html Note: "Then you test the devicename to see if it has a double underscore at the beginning, if it has test to see if the devicename contains the strSession value." You just to have to translate the VB6 code to VO. HTH, Jamal wrote in message news:b24262bb-af21-4cf8-a09f-bcf293f06f72@googlegroups.com... Hello all, On a terminal server, GetPrinters retrieve all the installed printer on the server... even the printer currectly conntected by other users ! I need the same list of printer that the list avaiable with ShowPrintDlg How can I get this list ? I need that because I have to deal with (redirected xx) that is appended at the end of the printer name, and if I want to save a current printer, I have to remove that... and then, at the next session find the new redirected printer Jean-Luc
[toc] | [prev] | [next] | [standalone]
| From | Jean-Luc Stassen <jls@igsoft.be> |
|---|---|
| Date | 2013-02-02 06:58 -0800 |
| Message-ID | <e334bbfe-06a8-4b17-b9cb-f103391d623a@googlegroups.com> |
| In reply to | #4571 |
Hi Jamal and David, Thank you for your clues... In my app (on a 2008 TS), the user can select the printer he want to use to print the invoices. So in the app, he can select a printer and then save it. The printer name as the form: Brother MFC-9970CDW Printer (redirected 2). This is not the default printer. On his next session, the printer is now redirected with another number, for example: Brother MFC-9970CDW Printer (redirected 5) But the app try to print on the saved Brother MFC-9970CDW Printer (redirected 2), and as this name doesn't exist anymore, the default printer is used ! So, thanks to the David's clues, I find in the registry the current session # so I can change it before to print... and my problem is solved... I just now have to tried in production, but in test envionment, it works. Jean-Luc
[toc] | [prev] | [next] | [standalone]
| From | dlzc <dlzc1@cox.net> |
|---|---|
| Date | 2013-02-02 09:52 -0800 |
| Message-ID | <ac4e03eb-0dc2-42a8-9c63-5bc38656c599@googlegroups.com> |
| In reply to | #4711 |
Dear Jean-Luc Stassen: On Saturday, February 2, 2013 7:58:44 AM UTC-7, Jean-Luc Stassen wrote: > Hi Jamal and David, > > Thank you for your clues... > > In my app (on a 2008 TS), the user can select the > printer he want to use to print the invoices. > > So in the app, he can select a printer and then > save it. The printer name as the form: > Brother MFC-9970CDW Printer (redirected 2). This is > not the default printer. > > On his next session, the printer is now redirected > with another number, for example: > Brother MFC-9970CDW Printer (redirected 5) > > But the app try to print on the saved Brother > MFC-9970CDW Printer (redirected 2), and as this name > doesn't exist anymore, the default printer is used ! > > So, thanks to the David's clues, I find in the > registry the current session # so I can change it > before to print... and my problem is solved... > > I just now have to tried in production, but in test > envionment, it works. No thanks to me. But thanks to you for trying, and telling posterity what *does* work. You help make this resource rich. Could you provide us the code snippet that identifies the current session number? (When convenient, and after you are satisfied.) Thank you. David A. Smith
[toc] | [prev] | [next] | [standalone]
| From | Jean-Luc Stassen <jls@igsoft.be> |
|---|---|
| Date | 2013-02-05 11:11 -0800 |
| Message-ID | <72280106-07bf-4f0e-bd54-e95a3f591b3c@googlegroups.com> |
| In reply to | #4714 |
Hi David,
here is what I finaly done:
I save the printer name **without** the redirect term then I overclass the Print method of Reportpro, in it I add the correct redirect term:
oHKCU :=FabRegistry{ "Volatile Environment" ,HKEY_CURRENT_USER}
IF oHKCU<>NULL_OBJECT
a:=oHKCU:GetSections()
// always one key here
IF ALen(a)>0
// add the current redirection depend of the system language
IF GetSystemDefaultLangID()==MAKELANGID(LANG_FRENCH,SUBLANG_FRENCH_BELGIAN) .OR.;
GetSystemDefaultLangID()==MAKELANGID(LANG_FRENCH,SUBLANG_FRENCH)
credir := "(redirection de "
ELSEIF GetSystemDefaultLangID()==MAKELANGID(LANG_DUTCH,SUBLANG_DUTCH_BELGIAN) .OR.;
GetSystemDefaultLangID()==MAKELANGID(LANG_DUTCH,SUBLANG_DUTCH)
credir := "(redirect van "
ELSEIF GetSystemDefaultLangID()==MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_UK) .OR.;
GetSystemDefaultLangID()==MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US)
credir := "(redirected "
ELSE
credir := "(redirection de "
ENDIF
cprinter := cprinterbase + " "+ credir + AllTrim(a[1])+")"
ENDIF
ENDIF
I juste have to test that in full working environment, but it would work !
Jean-Luc
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web