>Preallocation doesn't help. I still believe that the problem is in the data type difference - VB is passing string variables by reference and getting values back naturally, while VFP is producing DLL exception error. that is, VFP cannot pass to DLL the memory pointer to the string variable.
Umm, that's not true. Go search
http://support.microsoft.com for "howto pass structures to a dll" for a KB article that demonstrates doing exactly this.
Mike Stewart