Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing parameters to the init of a com object
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01590272
Message ID:
01590763
Vues:
43
>>Apologies for a very basic query: I have built a DLL and am trying to pass in a parameter to set a property in a class via the INIT - see code below ; however it always returns an empty string i.e. the value given it when the class is defined, instead of say "P" as in the example below. The parameter being passed via the INIT is being ignored. I can get round this by using a procedure in the class to set the variable but I would have thought I should not have to do this?
>>
>
>In addition to the responses you got already, if you need to pass parameters to your methods the VFP function needs to use the "inline" parameter format, not LPARAMETERs. Ex. It should be written as:
>
>
>DEFINE CLASS myOLE AS Session OLEPUBLIC
>   FUNCTION DoSomething(tcValue AS String)
>   ENDFUNC
>ENDDEFINE
>
>
>(The "As String" isn't really necessary if you want to exclude it).
>
>BTW - passing parameters to the constructor isn't a VFP limitation - it's just not supported by COM.

Hi Paul
Thanks for the additional tip.
Barry
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform