I am trying to pass a string array from c# into c++ and manipulate the data of that array. How can I do this? (I am c++ newb)
c++
c#
I tried this, but I get two japanese chars..
c++
Code:
__declspec(dllexport) int __stdcall Test(LPCTSTR* as_test) { as_test[0] = L"This is new data"; return 0; }
Code:
[DllImport("PBNI.dll", CharSet = CharSet.Unicode)] static extern int Test(ref String[] as_ret); public void Testing() { String[] ls = new String[] { "replace me", "more data", "even more" }; Test(ref ls); Console.WriteLine(ls[0]); }
Comment