hi,
I am in trouble now!
I have a dll , i want get same altered values from the parameters by passing pointers as arguments to a function.my function definition is as following.
========mydll.h========
##ifdef __cplusplus
extern "C" {
#endif
__declspec(dllexport) char *str (int *num,char **ch);
#ifdef __cplusplus
}
#endif
=========mydll.cpp======
#include "mydll.h"
char *str(int *num,char **ch)
{
char *pstr = "this is string!";
*num = 10;
*ch =pstr;
return *ch;
}
and then I create another project to test this dll ,it works correctly. but if I use labview to call the dll,it is incorrect.
in c++,call the function as follows:
int a = 0;
char *b ="";
char *rtnStr = str ( &a,&b);
after executing the "str" function,the return value and all arguments are:
a = 10;
b = this is string!
rtnStr = this is string!
but in labview, I wrap this dll by setting return value as string(c string pointer),setting parameters as numeric (pointer to value) and string(c string pointer).
I think my setting is correct!
but the result is incorrect!
a = 10
b =(unknowing char)
rtnStr = this is string!
Why "b" can not get the string as calling in C++? if I want to get the value by passing pointer. How should I do ?