If you make the managed code method take a System::String* then in C++ you
can get a wchar_t like this:
System::String* fontName = ....
const wchar_t __pin* szFontName = PtrToStringChars( fontName );
Visual Programming Ltd mail PO Box 22-222, Khandallah, Wellington, New
Zealand site Level 2, 2 Ganges Road, Khandallah, Wellington, New Zealand
phone +64 4 479 1738 fax +64 4 479 1294 web
http://www.xmlpdf.com
"Scafe" <an*******@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
the problem maybe is that the call of your method have a
pointer, char * , and need to be in 'unsafe' block of
code. if you write
unsafe{
myfunction(ref mystring);
}
maybe works. remember to configure in the C# proyect
properties to accept unsafe blocks of code
-----Original Message-----
Hello.
I have some class written in C++ and I'm trying to use it
in C#. So I'vecreated new Managed C++ Library in Visual Studio .NET and
copied thatcode there. But one method takes one parameter of type
char*. When I'mtrying to use it in C#, calling it with some string, the
compiler givessome errors. I was also trying to change this char* to
String, but theerrors were very similar. Is there any way to do this???
--
Piecu
.