Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Crear DLL's en VFP y usarlas en VFP
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01022841
Message ID:
01022847
Vues:
11
Ricardo,

Creas primero un projecto, digamos miProjectoDLL, luego creas un programa, digamos MiClase.PRG, donde escribes:
define class miClaseFoxDLL as Custom OLEPUBLIC
	FUNCTION Calcular(n,m)
		LOCAL nRet
		   nRet = (n * m)
		RETURN nRet
	endfunc
enddefine
Ahora compilas tu programa, por ejemplo usando la tercera opción COM SERVER (EXE) y luego ya puedes usarla usando
miClase = createobject('miProjectoDLL.miClaseFoxDLL') && Como vez es NombreProjecto.NombreClase
? myClase.Calcular(10, 30)
[Update]
Es mejor poner el tipo a los parametros y a los valores que devuelven las funciones, por ejemplo:
FUNCTION Calcular(n as Decimal, m as Decimal) as Decimal
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform