title: A c++ dll to manipulate string to use in vba
body: <p>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.</p>
  
  <p>the steps once more :</p>
  
  <p>1.a dll with a function with string pointer as an argument.</p>
  
  <p>2.vba empty string will be passed to the function.</p>
  
  <p>3.the dll will modify or manipulate the string.</p>
  
  <p>4.finally the modified string will be used in vba.</p>
  
  <p>the function inside the dll is somewhat like:</p>
  
  <p>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*"</p>
  
  <p>i modified the function by writing</p>
  
  <p>_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.</p>