Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with VB DLL
Message
De
08/08/2013 05:03:55
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Problem with VB DLL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP3
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01580026
Message ID:
01580026
Vues:
139
Hi,

I'm stuck with a problem calling an external DLL. I'm able to call the dll in an Excel VBA Makro and it works.
The Problem is that the dll needs two Parameters as a struct. I have been dealing with the problem for several days now I need some help if this is possible.

Here is the declaration of the dll as it works in VBA:

Public Declare Function vbHvsCodeTeze Lib _
"C:\Test\HvsCodeDll.dll" _
(ByRef vHvsCode As HvsCode, vHvsAdr As HvsAdr) As Long

Here are the Type DEFS :


Type HvsAdr
pszLkz As String
pszPlz As String
pszOrt As String
pszStr As String
End Type

Type pHvsAdr
pszLkz As Long
pszPlz As Long
pszOrt As Long
pszStr As Long
End Type

Type HvsCode
szDepot(3) As Byte
szDepotName(20) As Byte
szTeze(4) As Byte
szStr(50) As Byte
szHaus(4) As Byte
szZus(1) As Byte
szPlz(10) As Byte
szOrt(50) As Byte
szVon(6) As Byte
szBis(6) As Byte
szTyp(1) As Byte
szVersion(4) As Byte
szLkz(3) As Byte
szErrMsg(254) As Byte
End Type

And here ist the function call:

Dim Adr As HvsAdr
Dim vGet As HvsCode

Adr.pszLkz = "DE" &&country Code
Adr.pszPlz= "30559" && Zip Code
Adr.pszOrt = "Hannover" && City Name
Adr.pszStr ="Haupt Str. 4" && Streetname and Number


Function Call:

The structure Adr holds the input values
The structure vGet is passed as Reference because its values are changed by the called function (The needed Return values)

errCode = vbHvsCodeTeze(vGet, Adr)

The only thing I get is an exception or type mismatch

Is it possible to get it work in VFP (9.0) ??

Any Ideas / Help

Thanks in Advance

Jörg
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform