>>Hi all,
>>
>>I want to use an API which is explicitly written for VB. This API takes a string parameter passed by reference as argument.
>>
>>All other API's explicitly written for VB which do not take strings as argument succeed.
>>
>>By testing with other API's I came to the conclusion these api's failed because of that the stringformat of the parameter
>>
You can use a static buffer allocated in memory outside of VFP to hold the data, and construct a BTR-compatible item in the buffer. You'd need to use something like POINTERS or CLSHEAP to do this. You could pass a pointer to the buffer by reference (declare the item as INTEGER @ in the DECLARE...DLL, and then pass an integer value containing a pointer to the buffer by reference in the call. On return, you'd copy the content of memory pointed to by the integer back into a VFP string variable. POINTERS and CLSHEAP both have functions to allocate, copy from and copy to memory buffers.
>>I know that VB uses an other stringformat (BSTR) than VFP (?)
>>
>>How do I solve this problem ??
>>
>>Regards, Walter
>Walter,
>First I would try to pass string by ref. :
>lcString = "myString"
>myAPICall(@lcString)
>Cetin