Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Generate Version 1 UUIDs
Message
De
21/09/2017 06:30:38
 
 
À
21/09/2017 05:45:26
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
SAMBA Server
Database:
MySQL
Application:
Desktop
Divers
Thread ID:
01654423
Message ID:
01654480
Vues:
74
>Ooww.. that is bad design. Relying on VFP specific principles and breaking several other rules that is only known to very few is very, very bad.
>Much better is to write a class that can be instantiated where the declaration of the API occurs only once in the declaration. Keep it simple.

Seen this quite often, with a function instead of a prg:
function apifunc(parms)
declare apifunc in ...
return apifunc(parms)
VFP searches in API functions before those in set('procedure')
example:
FUNCTION GetLastError
set step on 
DECLARE INTEGER GetLastError IN Win32API 
RETURN GetLastError()
ENDFUNC

? GetLastError() && set step on fires
? GetLastError() && set step DOES NOT fire
RETURN GetLastError() would recurse infinitely if the API function was not called first.

GDIplusX has a bunch of these, though using an alias, eg.:
*********************************************************************
FUNCTION xfcGdipGetMetafileHeaderFromStream(stream, header)
*********************************************************************
	DECLARE Long GdipGetMetafileHeaderFromStream IN GDIPLUS.DLL AS xfcGdipGetMetafileHeaderFromStream Integer stream, String @header
	RETURN xfcGdipGetMetafileHeaderFromStream(m.stream, @m.header)
ENDFUNC
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/
Never explain, never complain (Queen Elizabeth II)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform