|
From: chris n. <cnu...@gm...> - 2006-12-03 18:40:31
|
Hello all. I needed to get wide strings working correctly in csharp, so yesterday a buddy of mine and I sat down and put things together. I have attached a file that contains a test solution along with the changes I made to std_string.i and a new file, std_wstring.i in the csharp lib. This runs without any errors on a windows system. I switched to code-marshalling as opposed to attribute return value marshalling (MarshalPtrToString[Ansi,Uni] as opposed to return: MarshalAs(UnmanagedType.LP(W)Str) because I was getting RtlHeapFree errors with the return value marshalling. The test project has a full test class with std strings passing in and out of functions in most combinations of const and reference. This is tested through the main function of the csharp class. I could not get typemap(typecheck) to work for wstrings, and I removed the ones for strings due to copying and pasting the wstring implementation once I figured out why the RtlHeapFree errors were happening. Chris |