Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printer Dialog in FPW 2.5
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00046794
Message ID:
00047345
Vues:
28
Sorin,

Thanks for the info on VFP. I can't wait to get into it. We're really close on several projects to moving into that arena. I've found some more information on methods to use in FPW 2.6. There are several flavors of GETPRINT floating about. I'm going to compare what others have done to what I did and see if I can't find a method that works "most" of the time.

Thanks for the responses,

Rod lewis

>Rod,
>SYS(1037) has not changed in VFP, but in VFP you can SET PRINTER TO NAME YourPrinterName. There is also a function APRINTERS() that will fill an array with the available printer names, or you can use GETPRINTER() another function specific to VFP that will return the printer name picked by the user. But that's VFP whereas in my previous message I was trying to describe a technique to use in FPW26 to accomplish something that in VFP you can do with SET PRINTER TO NAME (GETPRINTER()).
>Therefore, I don't see the need for SYS(1037) in VFP since there are so many other more convenient ways to display a printer dialog and return the selection.
>
>Sorin
>
>
>>Sorin,
>>So the problem with SYS(1037) has been fixed in VFP? Also, can you set a specific printer and over-ride the SYS(1037) setting now? If those 2 things are corrected, I'll be moving several apps to VFP ASAP!
>>
>>TIA,
>>
>>Rod Lewis
>>
>>>Rodney,
>>>I had experienced the same problem some time ago with a large app written in FPW26. what I ended up doing may seem complicated but that was the only way I could find. SYS(1037) was not the solution since you have no way of telling that the user cancelled the selection.
>>>FPW26 reads WIN.INI to get the printer settings (regardless of the Windows version) so, using GetProfileString and WriteProfileString through Foxtools.fll. I get the printer name, port and driver from the [devices] section in Win.ini into an array aPrinters. The printer dialog (list) is built based on aPrinters. The user selection is used to reference the array row that stores the information about the selected printer, which is fed back to a procedure that will write the device= setting in the [windows] section of Win.ini (that sets the default printer). The report form is then executed, that's when FPW will read win.ini and print the report to the windows default printer.
>>>Make sure that the tag and tag2 fields in the frx file are blank, otherwise the value stored in the tag fields will take precedence over the settings in win.ini.
>>>Still, once in a while we get the error message "Could not allocate global memory" when accessing winapi functions through Foxtools' CallFn(). I couldn't find any fix to that.
>>>Also, there is an article in the MS Knwoledege Base that explains how to use winapi to get ini file settings, but I guess you've gone through that.
>>>As for the hair, it will grow back when you'll move to VFP.
>>>
>>>HTH,
>>>Sorin
>>>
>>>
>>>>I've got a client that won't upgrade their app to 2.6 and we've needed to access the Windows Printer dialog. I utilized some code that I have found using FOXTOOLS using GETPROFILESTRING and WRITEPROFILESTRING, but fairly often they get memory overflow errors. We are also seeing this on multiple machines in our office as well. Has anyone written a "good" printer dialog box for FPW? I also have a need for this in FPW 2.6 unless someone knows of a way to override the selected printer from SYS(1037). I have an application that pre-selects several printers for different reports. If you use SYS(1037) and they select a different printer from default, that printer overrides any printer set in Windows, so the automatic switching of printers within the reporting won't work. It all goes to the last selected printer. This is an aggravating "feature" of FPW. If anyone has any thoughts, I would very much appreciate the ideas. I don't have a lot of hair left to pull out!
>>>>
>>>>Rod Lewis
>>>>MS Consulting, Inc.
>>>>Minneapolis, MN
Rod Lewis
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform