How do I return a string array in c# and use it in unmanaged c++? -
Can anyone tell me how to return a string array by one method and use it in C #?
Suppose I have to return the array in {one, two, ..... ten} and c ++, I have to display this array on the console and do some action.
It did not make me self, but on an estimate:
to create an assembly in C # For Csharpassembly.dll is called with the following class
using the system; Namespace CesarPadaccations {public class} CSharpClass {public static string [GetStrings ({return new string} ["1", "2", "3"})); }}}
But in your case create an assembly that creates this assembly in C # and HAA MC ++ program context and call it:
#include "stdafx.h" #using & lt; Mscorlib.dll & gt; # Using "csharpassembly.dll" using the namespace system; Namespace Csharpassembly using __gc class {public: static zero} ProcessCShaperStrings () {array ^ stringArray = CSharpClass :: GetStrings (); Console :: lineline (string array [0]); ... // e.t.c } }; Int wmain (zero) {Test :: ProcessCShaperStrings (); Return 0; }
Comments
Post a Comment