开发者

How to receive strings from C# in Visual-C++ based .net DLL?

How to receiv开发者_开发技巧e strings from C# in Visual-C++ based .net DLL?

In C++ (using clr) I have this code:

#include "stdafx.h"
##include <Windows.h>
#include <string>
#include <windows.h>

namespace NSST
{
  public ref class Wrapper
  {
 public:
     Wrapper() {}
    static void init_1(std::string a, std::string b){}
     static void init_2(){}
  };
};

But in .net C# I see only one function init_2. How do I make init_1 visible in .net?


You can't use std::string, you should use System::String^:

static void init_1(System::String^ a, System::String^ b);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜