i'm a newbie in c++ and tring to create a dll with c++ which will be accessed from excel vba,inside the dll i hve a function which will take string as argument and modify the string and atlast the modified string will be used in the vba.
the steps once more :
1.a dll with a function with string pointer as an argument.
2.vba empty string will be passed to the function.
3.the dll will modify or manipulate the string.
4.finally the modified string will be used in vba.
the function inside the dll is somewhat like:
extern "C"_declspec(dllexport) void WINAPI ModifyStr(char* str) { Str = "Hello" } the following error is thrown by the compiler "deprecated conversion from string constant to char*"
i modified the function by writing
_declspec(dllexport) void WINAPI ModifyStr(string** Str) { *Str = new string("hello"); } this code is compiled well but when i tried to call the function from vba it resulted in program crash.Please help me get rid of this problem and build my dll without any error.