You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please refer to this repo for a reproducible example. If you build and run the app you'll get the issue faced.
I have a simple class with one constructor that takes a LPCSTR (typedef for const char*) param, and has a member of the same type.
The member generation is fine, however the constructor generation is incorrect. The constructor is imported as: internal static extern global::System.IntPtr ctor(global::System.IntPtr __instance, global::System.IntPtr lpsz);
Brief Description
Please refer to this repo for a reproducible example. If you build and run the app you'll get the issue faced.
I have a simple class with one constructor that takes a
LPCSTR
(typedef forconst char*
) param, and has a member of the same type.The member generation is fine, however the constructor generation is incorrect. The constructor is imported as:
internal static extern global::System.IntPtr ctor(global::System.IntPtr __instance, global::System.IntPtr lpsz);
With the generated C# equivalent looking like:
The last line is failing because the imported signature is expecting an
IntPtr
, but the generated class is using aSystem.String
.Is there a way to generate the import signature with the correct type, or modify the generated code to correctly convert to and from
LPCSTR
.The
LPCSTR
member is generated fine with the correct marshaling:The constructor however is not.
Thanks.
OS: Windows
Target: MSVC
The text was updated successfully, but these errors were encountered: