From fe7beb5f08d3beacf927858842dcac1d35f49917 Mon Sep 17 00:00:00 2001 From: triton Date: Wed, 23 Jan 2013 10:06:04 +0000 Subject: [PATCH] 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. --- src/Generator/Generators/CLI/CLIMarshal.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Generator/Generators/CLI/CLIMarshal.cs b/src/Generator/Generators/CLI/CLIMarshal.cs index dd0c617c..acefbdf3 100644 --- a/src/Generator/Generators/CLI/CLIMarshal.cs +++ b/src/Generator/Generators/CLI/CLIMarshal.cs @@ -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 += "&";