Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem calling a DLL function
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00166967
Message ID:
00167537
Views:
16
Hi Ed,

I did a bit of digging I'm not sure I like what I've found.
Following is more VB code showing the TYPE for SLS_CHALLDATA.
There appears to be some nesting which is a little intimidating.


Type SLS_MSG_DIGEST
MessageDigest(16) As Byte 'binary data
End Type

Type SLS_CHALLDATA
SecretIndex As Long
Random As Long
MsgDigest As SLS_MSG_DIGEST
End Type

Type SLS_CHALLENGE
Protocol As Long
Size As Long
ChallengeData As SLS_CHALLDATA
End Type

It looks like SLS_CHALLENGE references SLS_CHALLDATA which further references SLS_MSG_DIGEST. Is this to say that I must construct a string for each of these structs ?
Also, do you know what MessageDigest(16) As Byte means ?

I'm beginning to wonder if I'm in a bit over my head here. Or is this just a nasty initiation reserved for rookies ?

Thanks.
>
>>
>>Type SLS_CHALLENGE
>> Protocol As Long
>> Size As Long
>> ChallengeData As SLS_CHALLDATA
>>End Type
>
>
>Oops. This will be a string, but we need to know what SLS_CHALLDATA looks like before we can construct it.
>>
>>Declare Function SLS_REQUEST Lib "SlsApi" Alias "SLS_Request" ( _
>> ByVal pszProductID As String, _
>> ByVal pszUserName As String, _
>> pRequest As SLS_REQUEST, _
>> pPermit As SLS_PERMIT, _
>> plLicenceHandle As Long, _
>> pChallenge As SLS_CHALLENGE) As Long
>>
>
>
>VFP equivalent declaration, and converters for DWORDs:
>
>
DECLARE INTEGER SLS_REQUEST IN SLSAPI.DLL ;
> STRING @ lpszProductID, ;
> STRING @ lpsUserName, ;
> INTEGER SLS_REQUEST, ;
> STRING SLS_PERMIT, ;
> INTEGER plLicenseHandle, ;
> STRING SLS_CHALLENGE
Carl Chambers
Cardol Data Systems
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform