Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing numeric variable by reference
Message
De
21/06/2007 14:20:16
 
 
À
21/06/2007 12:26:18
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP
Divers
Thread ID:
01234773
Message ID:
01234827
Vues:
7
>Hello folks,
>
>I'm using a third party COM object that needs some variables to be passed by reference so information can be retrieved from them after the call. The strings are not a problem. However, the numeric variables are causing "OLE Error: Type Mismatch"
>
>
>ods = createobject("dserve2.dserve")
>ods.dsConnect("192.168.1.99",8227,40000)
>lnChannel = 1
>? ods.dsOpen("g:\ssi605\data\ic\icmast",@lnChannel)  && error here
>? ods.dsOpen("g:\ssi605\data\ic\icmast",lnChannel)  && works, but there is always the possibility
>                                                   && that the COM object assigns me a different channel
>
>
>
>The vendor does not have VFP knowledge...it is written in some sort of basic. On the previous version of the DLL, I wrote a VB wrapper around it. But this version (except for this problem) works great in VFP, and I really want to cut out the middle man.
>
>Any ideas?
>
>< update >
>For those who care, the COM object communicates with a process running on a server, which provides an interface into our legacy accounting package (FACTS...written in Basis business basic).
>< /update >
>
>Thanks...

Maybe just convert the number to a string and pass that as a parameter by reference, I think the [4RS] flag is not available in VFP8, but you can find many equivalent routines in the web:


lnChannel = 1
lcBuffer = bintoc(lnChannel, [4RS]
ods.dsOpen("g:\ssi605\data\ic\icmast",@lcBuffer)
lnChannel = ctobin(lcBuffer, [4RS])
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform