title: .NET ambiguous match found
body: <p>Good afternoon to everybody,
  I start saying I've never used .NET library before today.</p>
  
  <p>FOREWORD</p>
  
  <p>I've an application that use NiceLabel 6 (via ActiveX) in order to print customer labels. 
  Now the new version on NiceLabel (2017) doesn't support anymore thus technology, but only works with .NET.
  I've created the .pas unit reading the .NET library through CrystalNet .Net Runtime Library for Delphi.</p>
  
  <p>.NET USED IN DELPHI</p>
  
  <p>I've created a simple Delphi project that use the .pas unit created from CrystalNet product. Here is the source:</p>
  
  <pre><code>unit Main;
  
  interface
  
  uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
    System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
    Vcl.StdCtrls, SDK.NET.Interface_;
  
  type
    TfrmMain = class(TForm)
      btnLoadLabel: TButton;
      procedure btnLoadLabelClick(Sender: TObject);
    private
      NLLabel: TILabel;
      NLLabelOle: OleVariant;
    public
      { Public declarations }
    end;
  
  const
    LabelPath = 'C:\Users\Eros\Desktop\nicelabel 2017\codesol\labels\';
  
  var
    frmMain: TfrmMain;
  
  implementation
  
  {$R *.dfm}
  
  procedure TfrmMain.btnLoadLabelClick(Sender: TObject);
  begin
    NLLabel := SDK.NET.Interface_.TILabel.Create(NLLabelOle);
  end;
  
  end. 
  </code></pre>
  
  <p>THE PROBLEM</p>
  
  <p>Delphi compile correctly but when I run it ib obtain this error:</p>
  
  <p><a href="https://i.stack.imgur.com/UnxgU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UnxgU.png" alt="enter image description here"></a></p>
  
  <p>I can't get the English version of this error but I think it is something like: "Ambiguous match found".
  I can't understand with is the problem and I'm very ignorant in theme of .NET.</p>
  
  <p>I think there is something not right in the units created by CrystalNet but I can't understand what is. In order to clarify here is a portion go the unit generated the is about 3.000 lines long</p>
  
  <pre><code>uses
      CNClrLib.Host, CNClrLib.Core, CNClrLib.Host.Utils, CNClrLib.Collections,
    CNClrLib.System, CNClrLib.IO, CNClrLib.Runtime, CNClrLib.Xml,
    CNClrLib.Drawing, CNClrLib.TypeNames, SDK.NET.Interface_Enums,
    SDK.NET.Interface_Const;
  
  type
  { Forward Declarations }
  
      TIVariable = Class;
      TIFieldList = Class;
      TIDocumentRevisionArray = Class;
      TIDocument = Class;
      TIField = Class;
      TILabelObjectList = Class;
      TILabelSettings = Class;
      TIPrintSettings = Class;
      TIVariableList = Class;
      TILabel = Class;
      TILabelPreviewSettings = Class;
      TIPrintRequest = Class;
      TIPrintToGraphicsSettings = Class;
      TIPrintToGraphicsResult = Class;
      TILabelObject = Class;
      TIPageLayout = Class;
      TIControlCenterProperties = Class;
      TIPrintServiceSettings = Class;
      TIDocumentStorage = Class;
      TISolution = Class;
      TSDKException = Class;
      TIPrintEngine = Class;
  
      ...
  
  {   TILabel }
  
      TILabel = Class(TClrBaseObject)
      private
          function Get_Author: String;
          function Get_DataSets: _GenericList;
          function Get_Description: String;
          function Get_Directory: String;
          function Get_FileName: String;
          function Get_FilePath: String;
          function Get_LabelObjects: TILabelObjectList;
          function Get_LabelSettings: TILabelSettings;
          function Get_PrintSettings: TIPrintSettings;
          function Get_Revision: Integer;
          function Get_Title: String;
          function Get_Variables: TIVariableList;
      public
          constructor Create(AObjVar: OleVariant);
          function Clone: TILabel;
          procedure CreateLabelVariant(outputFileName: String; printTimeDataSourceNames: _StringArray);
          function CreateXMLLabelInformation: _XDocument;
          procedure EndSessionPrint(sessionPrintRequest: TISessionPrintRequest);
          function GetLabelPreview(settings: TILabelPreviewSettings): Olevariant;
          function Print(quantity: Integer): TIPrintRequest;
          function PrintAll: TIPrintRequest;
          function PrintAllAsync: TIPrintRequest;
          function PrintAsync(quantity: Integer): TIPrintRequest;
          function PrintToGraphics(settings: TIPrintToGraphicsSettings): TIPrintToGraphicsResult;
          procedure SaveAs(fileName: String; overwrite: Boolean);
          procedure SessionPrint(quantity: Integer; sessionPrintRequest: TISessionPrintRequest);
          procedure SetVariableValues(variablesList: String; ignoreMissingVariables: Boolean);
          procedure SetVariableValuesXml(variablesList: String; ignoreMissingVariables: Boolean);
          function StartSessionPrint: TISessionPrintRequest;
          procedure StoreToPrinter(labelName: String; storeVariant: String);
          property Author: String read Get_Author;
          property DataSets: _GenericList read Get_DataSets;
          property Description: String read Get_Description;
          property Directory: String read Get_Directory;
          property FileName: String read Get_FileName;
          property FilePath: String read Get_FilePath;
          property LabelObjects: TILabelObjectList read Get_LabelObjects;
          property LabelSettings: TILabelSettings read Get_LabelSettings;
          property PrintSettings: TIPrintSettings read Get_PrintSettings;
          property Revision: Integer read Get_Revision;
          property Title: String read Get_Title;
          property Variables: TIVariableList read Get_Variables;
      end;
  
  
  ...
  
  {   TILabel }
  
  constructor TILabel.Create(AObjVar: OleVariant);
  begin
      inherited Create(AObjVar);
  end;
  
  function TILabel.Clone: TILabel;
  begin
      Result := TILabel(TClrBaseObject.CreateInstance(InvokeMethod('Clone')));
  end;
  
  procedure TILabel.CreateLabelVariant(outputFileName: String; printTimeDataSourceNames: _StringArray);
  begin
      InvokeMethod('CreateLabelVariant', [S_CnClr_System_String, sC_Sys_StringArray], [outputFileName, printTimeDataSourceNames]);
  end;
  
  function TILabel.CreateXMLLabelInformation: _XDocument;
  begin
      Result := CoXDocument.Wrap(InvokeMethod('CreateXMLLabelInformation'));
  end;
  
  procedure TILabel.EndSessionPrint(sessionPrintRequest: TISessionPrintRequest);
  begin
      InvokeMethod('EndSessionPrint', [sC_NicSDK_ISessionPrintRequest], [GetDefaultIntf(sessionPrintRequest)]);
  end;
  
  function TILabel.GetLabelPreview(settings: TILabelPreviewSettings): Olevariant;
  begin
      Result := InvokeMethod('GetLabelPreview', [sC_NicSDK_ILabelPreviewSettings], [GetDefaultIntf(settings)]);
  end;
  
  function TILabel.Print(quantity: Integer): TIPrintRequest;
  var
      objVar: OleVariant;
  begin
      Result := nil;
      objVar := InvokeMethod('Print', [S_CnClr_System_Int32], [quantity]);
      if VarIsAssigned(objVar) then
          Result := TIPrintRequest(TClrBaseObject.Create(objVar));
  end;
  
  function TILabel.PrintAll: TIPrintRequest;
  begin
      Result := TIPrintRequest(TClrBaseObject.CreateInstance(InvokeMethod('PrintAll')));
  end;
  
  function TILabel.PrintAllAsync: TIPrintRequest;
  begin
      Result := TIPrintRequest(TClrBaseObject.CreateInstance(InvokeMethod('PrintAllAsync')));
  end;
  
  function TILabel.PrintAsync(quantity: Integer): TIPrintRequest;
  var
      objVar: OleVariant;
  begin
      Result := nil;
      objVar := InvokeMethod('PrintAsync', [S_CnClr_System_Int32], [quantity]);
      if VarIsAssigned(objVar) then
          Result := TIPrintRequest(TClrBaseObject.Create(objVar));
  end;
  
  function TILabel.PrintToGraphics(settings: TIPrintToGraphicsSettings): TIPrintToGraphicsResult;
  var
      objVar: OleVariant;
  begin
      Result := nil;
      objVar := InvokeMethod('PrintToGraphics', [sC_NicSDK_IPrintToGraphicsSettings], [GetDefaultIntf(settings)]);
      if VarIsAssigned(objVar) then
          Result := TIPrintToGraphicsResult(TClrBaseObject.Create(objVar));
  end;
  
  procedure TILabel.SaveAs(fileName: String; overwrite: Boolean);
  begin
      InvokeMethod('SaveAs', [S_CnClr_System_String, S_CnClr_System_Boolean], [fileName, overwrite]);
  end;
  
  procedure TILabel.SessionPrint(quantity: Integer; sessionPrintRequest: TISessionPrintRequest);
  begin
      InvokeMethod('SessionPrint', [S_CnClr_System_Int32, sC_NicSDK_ISessionPrintRequest], [quantity, GetDefaultIntf(sessionPrintRequest)]);
  end;
  
  procedure TILabel.SetVariableValues(variablesList: String; ignoreMissingVariables: Boolean);
  begin
      InvokeMethod('SetVariableValues', [S_CnClr_System_String, S_CnClr_System_Boolean], [variablesList, ignoreMissingVariables]);
  end;
  
  procedure TILabel.SetVariableValuesXml(variablesList: String; ignoreMissingVariables: Boolean);
  begin
      InvokeMethod('SetVariableValuesXml', [S_CnClr_System_String, S_CnClr_System_Boolean], [variablesList, ignoreMissingVariables]);
  end;
  
  function TILabel.StartSessionPrint: TISessionPrintRequest;
  begin
      Result := TISessionPrintRequest(TClrBaseObject.CreateInstance(InvokeMethod('StartSessionPrint')));
  end;
  
  procedure TILabel.StoreToPrinter(labelName: String; storeVariant: String);
  begin
      InvokeMethod('StoreToPrinter', [S_CnClr_System_String, S_CnClr_System_String], [labelName, storeVariant]);
  end;
  
  function TILabel.Get_Author: String;
  begin
      Result := GetPropertyValue('Author');
  end;
  
  function TILabel.Get_DataSets: _GenericList;
  begin
      Result := CoGenericList.Wrap(GetPropertyValue('DataSets'));
  end;
  
  function TILabel.Get_Description: String;
  begin
      Result := GetPropertyValue('Description');
  end;
  
  function TILabel.Get_Directory: String;
  begin
      Result := GetPropertyValue('Directory');
  end;
  
  function TILabel.Get_FileName: String;
  begin
      Result := GetPropertyValue('FileName');
  end;
  
  function TILabel.Get_FilePath: String;
  begin
      Result := GetPropertyValue('FilePath');
  end;
  
  function TILabel.Get_LabelObjects: TILabelObjectList;
  var
      objVar: OleVariant;
  begin
      Result := nil;
      objVar := GetPropertyValue('LabelObjects');
      if VarIsAssigned(objVar) then
          Result := TILabelObjectList(TClrBaseObject.Create(objVar));
  end;
  
  function TILabel.Get_LabelSettings: TILabelSettings;
  var
      objVar: OleVariant;
  begin
      Result := nil;
      objVar := GetPropertyValue('LabelSettings');
      if VarIsAssigned(objVar) then
          Result := TILabelSettings(TClrBaseObject.Create(objVar));
  end;
  
  function TILabel.Get_PrintSettings: TIPrintSettings;
  var
      objVar: OleVariant;
  begin
      Result := nil;
      objVar := GetPropertyValue('PrintSettings');
      if VarIsAssigned(objVar) then
          Result := TIPrintSettings(TClrBaseObject.Create(objVar));
  end;
  
  function TILabel.Get_Revision: Integer;
  begin
      Result := GetPropertyValue('Revision');
  end;
  
  function TILabel.Get_Title: String;
  begin
      Result := GetPropertyValue('Title');
  end;
  
  function TILabel.Get_Variables: TIVariableList;
  var
      objVar: OleVariant;
  begin
      Result := nil;
      objVar := GetPropertyValue('Variables');
      if VarIsAssigned(objVar) then
          Result := TIVariableList(TClrBaseObject.Create(objVar));
  end;
  </code></pre>