Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SYS(1037) Causes C000005 crash if CANCEL/ESC.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00308812
Message ID:
00308916
Vues:
27
>>>>>If the following code is run and you hit ESC or click on CANCEL in the Dialog Box the program will crash with C000005 on the CREATE REPORT line. If you click on OK, everything will run fine.
>>>>>
>>>>>= sys(1037) && Page Setup Dialog Box.
>>>>>CREATE CURSOR Dummy (DumField C(1))
>>>>>CREATE REPORT TempRpt FROM Dummy
>>>>>ERASE TempRpt.Frx
>>>>>ERASE TempRpt.Frt
>>>>>
>>>>>I am using VFP 6.0 SP 3 on Win98.
>>>>>
>>>>>I have tried this after having set various printers as the Windows Default Printer via Settings -> Printers before running the code including Epson LQ 870 and HP LaserJet 6p with the HP driver and again setup with the Win98 driver.
>>>>>
>>>>>Can others duplicate the error and does anybody know a solution?
>>>>>
>>>>>TIA
>>>>>
>>>>>Ed
>>>>
>>>>Are you missing a REPORT FORM temprpt command?
>>>>
>>>>How about instead of using the SYS(1037) call you do something like this:
>>>>
>>>>CREATE CURSOR Dummy (DumField C(1))
>>>>CREATE REPORT TempRpt FROM Dummy
>>>>REPORT FORM TempRpt TO PRINTER PROMPT
>>>>ERASE TempRpt.Frx
>>>>ERASE TempRpt.Frt
>>>>
>>>>Does this help?
>>>
>>>Fred,
>>>
>>>Actually what I am doing is to have the user select the printer, paper size, and orentation and then saving this information to memory variables. I'm not running the Report Form but only using it to gather the information that is stored there by VFP in Expr, TAG and TAG2.
>>>
>>>This used to work fine. I just recently realized that it was crashing if the user hit Esc and don't know for how long that has been behaving this way.
>>>
>>>I see that Lewis Keim suggested that I go back to SP2 so I'll ask him what he knows about this.
>>>
>>>Thanks,
>>>
>>>Ed
>>
>>Ed,
>>
>>You're correct, it does crash with SP3. Have you tried using the Common Dialog printer control? You should be able to save those selections easily there, without actually creating/erasing the dummy report.
>
>Fred,
>
>I see that there is a VBPrinter ActiveX control. Is that the one you are talking about? I haven't tried it yet but I will and see what happens.
>
>Thanks,
>
>Ed

Ed,

No, there is an ActiveX control that comes with VFP6 for Common Dialogs. One of those is the Printer settings. Microsoft Common Dialog Control, version 6.0. Make sure it's activated under Tools/Options/Controls and the ActiveX controls radio button is selected and that control is checked.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform