Your problem might be that you need to send the DLL a string of sufficient size. In other words, you feed the dll a string that is already large enough to contain what will be put into it. In this way, the memory is reserved. Otherwise, you would have to use the LabVIEW memory management functions to allocate the memory inside the DLL.