I am trying to call a method of a c++ class that uses a string parameter but I have this error
Error CS0570 'Wrapper.write(int, ?)' is not supported by the language
Basically I have this code, and it works with other simple methods without string object
I read this but as they are not static methods I can't use it
Any idea?
In C#
Wrapper tb = new Lib.Wrapper();
tb.write( 1, "tablas.txt");
In C++ Lib.h
private:
myCppClass* pMyCppClass;
public:
Wrapper();
int write(int id, String^ file);
And C++ Lib.cpp
int Lib::Wrapper::write(int id, String^ file)
{
std::string aux= marshal_as < std::string > (file);
return pMyCppClass->write(id, aux);
}