When calling a string-related external function in .NET targets, you must modify the function's source code in the DLL to allocate memory for the string.
If the original source code looks like this:
char* WINAPI fnReturnEnStrA() { return "ANSI String"; }
Sybase recommends that you change it to:
#include <objbase.h> ... ... char* WINAPI fnReturnEnStrA() { char* s = (char*)CoTaskMemAlloc(12); memcpy(s, "ANSI string\0", 12); return s; }