Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Install in every computer Custom Paper Size?
Message
 
 
À
29/10/2003 13:50:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00840704
Message ID:
00844248
Vues:
33
>
>Now you are getting there! Getting around the external classes is a nice step. Works fine here on local and network printers (all on Win2K PCs). Now, how about a quickie form removal class? ;-)

No problem :-).
* Goes into LoadApiDlls
		DECLARE INTEGER DeleteForm IN winspool.drv;
			INTEGER hPrinter,;
			STRING  pFormName 

* DeleteForm method
	PROCEDURE DeleteForm(tcFormName, tcPrinterName)
	LOCAL lhPrinter, llSuccess

	IF PCOUNT() > 1
		This.cPrinterName = tcPrinterName
	ENDIF

	This.ClearErrors()
	lhPrinter = 0
	IF OpenPrinter(This.cPrinterName, @lhPrinter, 0) = 0
		This.cErrorMessage = "Unable to get printer handle for '" + This.cPrinterName + "."
		This.nApiErrorCode = GetLastError()
		This.cApiErrorMessage = This.ApiErrorText(This.nApiErrorCode)
		RETURN .F.
	ENDIF

	* Finally, call the API
	IF DeleteForm(lhPrinter, tcFormName) = 0
		This.cErrorMessage = "Unable to delete Form '" + tcFormName + "'."
		This.nApiErrorCode = GetLastError()
		This.cApiErrorMessage = This.ApiErrorText(This.nApiErrorCode)
		llSuccess = .F.
	ELSE
		llSuccess = .T.
	ENDIF
	= ClosePrinter(lhPrinter)
	RETURN llSuccess
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform