FWH 13:09 Default Printer

Re: FWH 13:08 Default Printer

Postby Antonio Linares » Tue Oct 08, 2013 2:20 pm

Oscar,

I also need this, please:

MsgInfo( GETPROFSTRING( "Devices", cModel, "" ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH 13:08 Default Printer

Postby Antonio Linares » Tue Oct 08, 2013 2:22 pm

Oscar,

This way:
Code: Select all  Expand view  RUN

  elseif cModel == nil
      cModel = ::GetModel() + "," + ::GetDriver() + "," + ::GetPort()
      MsgInfo( GETPROFSTRING( "Devices", cModel, "" ) )
      ::hDC := PRINTERDCFROMNAME( STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 1, "," ), cModel, STRTOKEN( GETPROFSTRING( "Devices", cModel, "" ), 2, "," ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH 13:08 Default Printer

Postby ORibeiro » Tue Oct 08, 2013 5:19 pm

With:
cModel = ::GetModel() + "," + ::GetDriver() + "," + ::GetPort()
MsgInfo( GETPROFSTRING( "Devices", cModel, "" ) )

The result is blank. Returns nothing.
Oscar Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
ORibeiro
 
Posts: 187
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Re: FWH 13:08 Default Printer

Postby Antonio Linares » Wed Oct 09, 2013 7:45 am

Oscar,

This is the current code for that else:
Code: Select all  Expand view  RUN

      ::hDC := GetPrintDefault( GetActiveWindow() )
      if ::hDC != 0
         cModel = ::GetModel() + "," + ::GetDriver() + "," + ::GetPort()
      endif
 


That should work for you, though you say that the selected printer does not remain selected all the app execution ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH 13:08 Default Printer

Postby ORibeiro » Wed Oct 09, 2013 10:47 am

Linares,

I'll try my users adapt to this new reality.

But the ideal is that the system working again as before, as Windows programs work. For example, the MS-Word. When you open a document and before printing, change the printer destination, every impression of MS-Word will come out this new printer, even if you open other documents, printing will be directed to this same printer as MS-Word is open. Without affecting in any way the standard printer control panel of Windows. That's how programs Fivewin for Windows should work.

Please do this test in MS-Word.

Thanks,
Oscar Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
ORibeiro
 
Posts: 187
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Re: FWH 13:08 Default Printer

Postby Antonio Linares » Wed Oct 09, 2013 12:54 pm

Oscar,

Where are you selecting the target printer ? From the preview itself ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH 13:08 Default Printer

Postby ORibeiro » Wed Oct 09, 2013 1:19 pm

Linares,

We select one of two ways:

In the menu system using the command:
GetPrintDC (GetActiveWindow ())

Or before printing with the command:
PRINTERSETUP ()

Thanks,
Oscar Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
ORibeiro
 
Posts: 187
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Re: FWH 13:08 Default Printer

Postby Antonio Linares » Wed Oct 09, 2013 1:36 pm

Here there is some code that may help for what you are looking for:

https://www.powerbasic.com/support/pbforums/showthread.php?t=15204

We need to migrate it to FWH
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH 13:08 Default Printer

Postby ORibeiro » Wed Oct 09, 2013 3:49 pm

Yes. This is the way.
Oscar Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
ORibeiro
 
Posts: 187
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Re: FWH 13:08 Default Printer

Postby Maurizio » Wed Oct 09, 2013 4:06 pm

I do not know if this can help

viewtopic.php?f=3&t=27371

Maurizio
www.nipeservice.com
User avatar
Maurizio
 
Posts: 825
Joined: Mon Oct 10, 2005 1:29 pm

Re: FWH 13:08 Default Printer

Postby Antonio Linares » Wed Oct 09, 2013 6:45 pm

Maurizio,

Thanks for your help. What Oscar is looking for is to set a default printer from our apps that remains selected all the app execution time and does not modify the WIndows default printer.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH 13:08 Default Printer

Postby StefanHaupt » Thu Oct 10, 2013 7:06 am

Oscar,

why don´t you use the TO <cPrinter> clause ?
Code: Select all  Expand view  RUN
PRINT oPrn TO <cPrinterName>


1: get all printers with GetPrinters() (function from xHarbour) or any other function.
2: select the desired printer and save it in a global var or in an ini-file.
3: use always the TO clause (PRINT...TO, REPORT...TO, etc)

That does not affect the windows default printer and is working fine. I always use this technic and I never had problems
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: FWH 13:08 Default Printer

Postby Antonio Linares » Fri Oct 11, 2013 7:44 am

Stefan,

Very good, many thanks

Many times we miss the simplest way to do things :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42118
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH 13:08 Default Printer

Postby ORibeiro » Wed Nov 13, 2013 11:44 am

Linares,

I'm with version FWH 13:09 Revision 2 and the selected printer is not getting active throughout the program. Should I make any changes in the source?

Thanks,

Code: Select all  Expand view  RUN

* Enhancement: Class TPrinter Method New() has been improved so the selected printer (default printer) remains the same all the app life. Thanks to Enrico!
viewtopic.php?p=152663#p152663
 
Oscar Ribeiro
OASyS Informática
Fwh18.02 + xHarbour 1.2.3 + Bcc72
User avatar
ORibeiro
 
Posts: 187
Joined: Mon Oct 20, 2008 6:33 pm
Location: Itu, Sao Paulo, Brazil

Re: FWH 13:09 Default Printer

Postby mastintin » Wed Nov 13, 2013 2:01 pm

User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 51 guests