Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Properly Declare an API Function?
Message
From
20/02/2013 10:33:44
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01566486
Message ID:
01566487
Views:
59
>Hi
>
>I would like to know the correct way to delcare the following C function in VFP:
>
>int SetServer_IP (int context, char *Value);
>
>I used:
>
>Declare Integer SetServer_IP In XTran.dll As PP_SetServer_IP Integer lnContext,String lcIP
>
>but I am wondering whether the it should be:
>
>Declare Integer SetServer_IP In XTran.dll As PP_SetServer_IP Integer lnContext,String @ lcIP
>
>Thanks,
>Simon

Depends

(1)
Declare Integer SetServer_IP In XTran.dll As PP_SetServer_IP Integer lnContext,String lcIP
When calling

The string lcIP cannot be changed by the api
The string variable is not preceded by @
lcIP = 'something'
 = SetServer_IP(123, m.lcIP)
You can pass null
 = SetServer_IP(123, null)
(2)
Declare Integer SetServer_IP In XTran.dll As PP_SetServer_IP Integer lnContext,String @ lcIP
The string lcIP can be changed by the api
The string variable is preceded by @
lcIP = 'something'
 = SetServer_IP(123, @m.lcIP)
Impossible to pass null
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform