1
Comment recevoir des chaînes à partir de C# dans une DLL .net basée sur Visual-C++?Comment recevoir des chaînes de C# dans une DLL .net basée sur Visual-C++?
En C++ (en utilisant clr) J'ai ce 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(){}
};
};
Mais en .net C# Je ne vois qu'une seule fonction init_2
. Comment afficher init_1
dans .net?
et comment transformer System :: String^un dans std :: string a? c'est possible? – Rella
Bien sûr, regardez ici: http://buffered.io/2007/03/02/net-systemstring-to-ansi-char/ –
Lien mis à jour pour cet article: http://buffered.io/posts/ net-systemstring-to-ansi-char/(serait bien si les anciens commentaires étaient modifiables aussi). –