DLL Returning String

BlitzPlus Forums/BlitzPlus Programming/DLL Returning String

Moore(Posted 2007) [#1]
what is the best way to return a string from a DLL function to a blitz function. Below is sample code of what I am trying to do. (oh its written in C++)

class name{
public:
   int ID; // key value
   char* buffer; // string I want to return
   name* next; // next item in link list
   static name* head; // first item in link list
}
name* name::head = 0; // initialize static member

BBDECL char* BBCALL functionName(int ID){
   name* temp = get_Name(ID);
   temp->buffer = "Hello world";
   return temp->buffer; // this crashes the app ********
}