Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Properly Declare an API Function?
Message
De
20/02/2013 11:35:18
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
01566486
Message ID:
01566504
Vues:
37
>Thank-you for your explanation. As I was testing it I discovered basically what you described. So when the variable is used as an input I am using it without the "@" but when it is an output then I am adding the "@".
>
>Simon
>
Right

I believe - for input, without @ - vfp copies the whole string before passing it.

Basically I only use without @ for any of the conditions below

- i need to be able to pass a null pointer, ie null
- I use a string constant, ie no variable name


For input, and a variable, I use @


>>>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform