Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Class vs DLL
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00944057
Message ID:
00944324
Vues:
24
Hi Steve,

You've declared parameter twice
>PROCEDURE FormatPrice(myPrice as String) 	&& 1st time - myPrice as String 		
Parameters MyPrice     && 2nd time
Pick wich one you want.

>Excuse me, for not getting the terms right and I will try to be clearer
>
>I have a class MyClass, with a method called FormatPrice
>that I can call from the command prompt like this
>
>SET CLASSLIB TO Classes
>oMyClass = CreateObject("myClass")
>myPrice = "1234444.444444444"
>?oMyClass.FormatPrice(myPrice)
>1234
>
>
>And the first line in my FormatPrice method is
>
>parameters MyPrice
>
>I have copied the code for the FormatPrice method to a prg class
>definition
>
>DEFINE CLASS 	testclass as Session olepublic	
>PROCEDURE 	FormatPrice(myPrice as String) 				
>Parameters MyPrice
>*** rest of code
>EndProc
>EndDefine
>
>then created a DLL like this
>
>Build Project 	VFPopubtest From oPubClass.prg	
>Build Mtdll 	VFPoPubTest From VFPoPubTest recompile
>
>Then at the command prompt called this function like this
>
>
>oVfpDll = CreateObject("VfpOpubTest.TestClass")
>myPrice = "1234444.444444444"
>? alltrim(oVfpDll.FormatPrice(myPrice)
>1234
>
>Normally, this works fine. However, suddenly, the oVfpDll.Format_Price
>does not work unless I first remove the "parameters MyPrice" statement
>from the Format_Price Method from MyClass. Of course if I do this, then
>the Format_PRice method, when called from MyClass, no longer works.
>
>I can't figure out why this is happening. I have tried unregistering the
>VFPoPubTest DLL and deleting it. Is there something else I can delete or try?
>
>Thanks so much
>Steve Elster
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform