>You can't call a DLL function that returns a string because there's no way for FoxPro - at least not without an FLL in between - to capture the pointer that the function returns. CDecl calling convention generally doesn't work - you can only really call DLLs with WINAPI calling convention which has all APIs pretty much returning numeric values and any 'real' return values returned in passed in buffers.
>
>Your best bet is to wrap the function in a .NET DLL and call it with wwDotnetBridge or plain COM interop.
Rick,
Yes, you can call a dll that returns a string. Done it in the past
It is my understanding that FoxPro allocs a string with the return value ( char*)
Been looking for an example -
https://msdn.microsoft.com/en-us/library/windows/desktop/ms647474(v=vs.85).aspxNow, how you declare and use it in C# - I don't know , tried with IntPtr but only the first char is returned (and converted to upper case)
function CharUpperTest()
declare string CharUpperA in user32.dll string s
local x,s
s = 'abc'
x = CharUpperA (m.s)
&& assert false
endfunc
Gregory