Browse Source

Add an explicitly dereference if trying to wrap class-based pointer types when doing class managed to native marshaling.

pull/1/head
triton 13 years ago
parent
commit
91ef36aad8
  1. 11
      src/Generator/Generators/CLI/CLIMarshal.cs

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

@ -398,14 +398,19 @@ namespace Cxxi.Generators.CLI
} }
else else
{ {
Return = string.Format("(::{0}*)&{1}", @class.OriginalName, if (!Context.Parameter.Type.IsPointer())
Return = "*";
Return += string.Format("(::{0}*)&{1}", @class.QualifiedOriginalName,
Context.Parameter.Name); Context.Parameter.Name);
} }
} }
else else
{ {
Return = string.Format("{0}->NativePtr", Context.Parameter.Name); if (!Context.Parameter.Type.IsPointer())
Return = "*";
Return += string.Format("{0}->NativePtr", Context.Parameter.Name);
} }
return true; return true;

Loading…
Cancel
Save