Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Christof Lange's Struct Library
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00291190
Message ID:
00291203
Views:
26
>The achKundeNavn looks like it's a fixed length zero-terminated string. In this case, define it as "z31:achKundeNavn". If it still returns an error code, please post the entire structure definition in VB code (it's usually easier to translate because all datatypes have been resolved *s*). Also, does the documentation say what kind of error you get?
>
>A common problem is alignment. It might be that achKundeNavn is not stored in 31 bytes, but actually in 34 bytes to get the long value on an even memory address. In C this is controlled by some compiler directives and various among different compilers. In this case, it should work, if you insert a dummy property having the type "c3:dummy".
>
>Christof

First of all, thanks for an essential add-on to VFP and a quick respons. (Hamburg is not very far from Tønsberg in the southern part of Norway :)

I think you're right about the strings in the structure being fixed length and zero-terminated. And there are some kind of dummy fillers in between the strings. This is the entire definition of the structure in Visual Basic from the manufacturer.

Public Type ReskInfo
lSize As Long ' Size of the entire structure
sKey As Integer
sFiller1 As Integer ' for future use
lKundeNummer As Long
szKundeNavn As String * 30
bNull_1 As String * 1
szAdresseI As String * 30
bNull_2 As String * 1
szAdresseII As String * 30
bNull_3 As String * 1
szPostNummer As String * 6
bNull_4 As String * 1
szPostSted As String * 25
bNull_5 As String * 1
szTelefon As String * 15
bNull_6 As String * 1
szFax As String * 15
bNull_7 As String * 1
szEmailAdresse As String * 64
bNull_8 As String * 1
szBankgiroNr As String * 15
bNull_9 As String * 1
szPostgiroNr As String * 15
bNull_10 As String * 1
szDeresRef As String * 30
bNull_11 As String * 1
szOrganisasjonsNr As String * 15
bNull_12 As String * 1
sKundeGruppe As Integer
sRabattGruppe As Integer
sPrisKode As Integer
sBehandlingsProfil As Integer
sDistriktsNr As Integer
sMedarbeiderNr As Integer
sFiller2 As Integer
dKredittGrense As Double
dSaldo As Double
End Type

... and the declaration of the two functions "RubHentKunde " and "RubLesKunde"

Declare Function RubHentKunde Lib "rubapi" (ByRef N As Long, ByRef M As ReskInfo) As Long

Declare Function RubLesKunde Lib "rubapi" (ByRef M As ReskInfo) As Long

The documentations states that the function could return these 3 values:

0 = Customer read
1 = No customer read
87 = The lSize parameter is incorrect

...and I receive "2" which is obviously not correct. I have asked for an explanation of this, but havent received an answer yet.

Still appreciate all kinds of help...

Petter
Previous
Reply
Map
View

Click here to load this message in the networking platform