QUOTE (greatwall @ Apr 5 2009, 08:39 PM)
There are a couple of issues really.
The statement
char **ch
declares a pointer to a pointer, so it is wanting to manipulate the reference you have to the string, I expect labview would have a few issues with that as it may cause loss of data because you are losing a reference to whatever that wire held. I really don't know how it would interact with labview, but I'd guess it might not be nice.
The return of (*ch) is pointless, you have already modified the callers data in the line (*ch = pstr;)
Now probably the biggest problem.
char *pstr = "this is string!";
declares a pointer that (potentially, compiler dependant) points into the data section of the DLL, this will possibly be marked read only by the OS and any code down the line that tries to alter that value would fail if so with an access violation.
It is far too compiler dependant to use.
It is probably this last factor that is causing issues, you would have to allocate a new chunk of memory and initialise it with the value. Additionally if the DLL moves out of memory then your memory reference would then be invalid.