Fix marshalling of std::wstring parameters in directors
std::wstring parameters on SWIG directors were being truncated to a single character due to marshalling inconsistencies. This patch applies the same MarshalAs(UnmanagedType.LPWStr) attribute to director delegate methods and allows std::wstrings to be successfully received in the C# code via director calls.
This commit is contained in:
parent
fc6269a3ca
commit
5b7447b20e
1 changed files with 6 additions and 2 deletions
|
|
@ -49,7 +49,9 @@ class wstring;
|
|||
%typemap(ctype, out="void *") wstring "unsigned short *"
|
||||
%typemap(imtype,
|
||||
inattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]",
|
||||
outattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]"
|
||||
outattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]",
|
||||
directorinattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]",
|
||||
directoroutattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]"
|
||||
) wstring "string"
|
||||
%typemap(cstype) wstring "string"
|
||||
%typemap(csdirectorin) wstring "$iminput"
|
||||
|
|
@ -88,7 +90,9 @@ class wstring;
|
|||
%typemap(ctype, out="void *") const wstring & "unsigned short *"
|
||||
%typemap(imtype,
|
||||
inattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]",
|
||||
outattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]"
|
||||
outattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]",
|
||||
directorinattributes="[global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]",
|
||||
directoroutattributes="[return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.LPWStr)]"
|
||||
) const wstring & "string"
|
||||
%typemap(cstype) const wstring & "string"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue