Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VB Call to API vs VFP
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00255827
Message ID:
00255838
Views:
18
Hi Stephane,

Instead of BYTE you can use SHORT, at least for me this works most of the time. Some calling convetions expand parameters to 32-bit values anyway. A BYTE ByRef is a STRING@ where the string is CHR(x). Please note that SHORT@ doesn't work in VFP 5.

The Type definition, a structure, can be resolved in VFP using my struct class (STRUCT.ZIP here in the library). With that class, the VB structure looks like this in VFP:
DEFINE CLASS LStatus AS STRUCT
   DStatus = 0
   DCode = 0
   PStstatus = 0
   cMembers = "l:DStatus,l:DCode,b:PStatus"
ENDDEFINE
Christof


>Hi I need to convert some VB Call to An API Function into VFP, The VB Call IS:
>
>Public Type LStatus
> DStatus As Integer
> DCode As Integer
> PStatus As Byte
>End Type
>
>Private Declare Function GETStatus Lib "SomeDLL.dll" ( _
> ByVal device As Integer, ByRef status As LStatus, _
> ByRef devStatus As Byte, ByVal mode As Byte) As Byte
>
>My biggest problems are the Variables type BYTE, how do they convert to VFP and also the Structure LSTATUS
>
>My Conversion is the following:
>
>DECLARE INTEGER GetStatus IN SOMEDLL ;
> INTEGER nDevice , STRING @STATUS, ;
> INTEGER @devStatus, INTEGER mode
>
>It does not work properly and dont return anything in the Status Variable, The VB Call works fine.
>
>Anyone help will be greatly appriciated.
>
>Thanks
--
Christof
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform