Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PRINTSTATUS & Detecting Printers on LPT1
Message
De
29/08/2005 16:00:53
 
 
À
28/08/2005 13:12:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01042326
Message ID:
01044897
Vues:
15
>>>>>PRINTSTATUS()does not work under Windows as it used to under MSDOS. Is there anyway that I can detect from a VFP9 application if a user has a printer attached AND SWITCHED ON on LPT1? At the moment if the printer is not attached or switched on the app just hangs.
>>>>>
>>>>>Thanks
>>>>>Barry Sutton
>>>>
>>>>Not really. Under Windows, the printer is attached to a spooler which is always on, no matter if the printer is turned on or not.
>>>
>>>Fred,
>>>Thanks for confirming that. Is there anyway to set up a timeout against the spooler so that I can avoid a hanging app in this circumstance?
>>>
>>>Barry.
>>
>>Neither situation should "hang". The only thing I've ever seen is that if no printer is defined at all, that can cause problems.
>>
>>You should be able to use SET("PRINTER",2) and if it's EMPTY() there is no printer installed.
>
>Fred,
>Sorry, my fault, I did not explain it properly: I am printing to a dot matrix printer from a text file I have created, and using CopyFile to do the business.
>
>
>DECLARE INTEGER CopyFile IN KERNEL32.DLL ;
>	   STRING @SourceFileName, ;
>	   STRING @DestFileName, ;
>	   INTEGER bFailIfExists
>	
>	CopyFile("c:\temp\holdprint.prn","lpt1",0)
>
>
>
>If the printer is not attached or switched off, the app hangs.
>
>Is there a DOS function that I could RUN to detect the presence/absence of a printer on LPT1?
>
>Regards
>Barry.

I agree with Christof, your app shouldn't hang. It may take awhile before it times out, though, or there is a dialog behind your app.
Fred
Microsoft Visual FoxPro MVP

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

Click here to load this message in the networking platform