Browse Source

Use the full qualified name for referring to the managed type constructor when doing native to managed marshaling. Use an explicit cast for the first argument. This fixes the case when the type being passed to the constructor is const.

pull/1/head
triton 13 years ago
parent
commit
fe7beb5f08
  1. 5
      src/Generator/Generators/CLI/CLIMarshal.cs

5
src/Generator/Generators/CLI/CLIMarshal.cs

@ -139,7 +139,10 @@ namespace Cxxi.Generators.CLI @@ -139,7 +139,10 @@ namespace Cxxi.Generators.CLI
if (@class.IsRefType)
Return = "gcnew ";
Return += string.Format("{0}(", @class.Name);
Return += string.Format("{0}::{1}(", Generator.Library.Name,
@class.Name);
Return += string.Format("(::{0}*)", @class.QualifiedOriginalName);
if (@class.IsValueType && !this.Context.ReturnType.IsPointer())
Return += "&";

Loading…
Cancel
Save