Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with DLL. Runs in VB, not VFP
Message
De
02/07/2002 12:50:40
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Problem with DLL. Runs in VB, not VFP
Divers
Thread ID:
00674563
Message ID:
00674563
Vues:
61
Hi everyone. I am trying to make a clarion dll work inside of VFP 5.0 I was given sample VB that works, but I can't seem to get it to work in Foxpro.

Here's the VB code:
Private Declare Sub StringsToFromVB Lib "vFCla" (ByVal s1$, ByRef adr As Long)
Dim tmp$
Dim adr As Long
tmp = Text1.Text
Call StringsToFromVB(tmp, adr)

The VFP code:
DECLARE GET2STRINGS IN "vFCla.dll" AS "StringsToFromVB" STRING s1, LONG @adr
tmp = ThisForm.Text1.Value
adr = 0
lcx = StringsToFromVB(tmp,@adr)

My problem is this: In VB, the Clarion DLL displays the string that VB passes, then writes a string and updates the variable "adr" with a pointer to a string. VB then uses another DLL to go get the string, but that is not an issue at the moment. The issue that I have is that the Clarion DLL blows Foxpro out of the water when it tries to update the "adr" variable that I am trying to pass by reference.

I don't know much about this stuff, but I know that the VB code I show above runs. In debugger, the "adr" variable is about a seven digit number when it's done. Foxpro just craps out.

Can anyone with VB experience and VFP experience, help me out? I have tried using the @ symbols and not using them. Same result.

Thanks in advance,
Tim
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform