Salve Todos.

 

Preciso de uma luz.  Preciso usar uma DLL do Delphi no centura 1.5.

Pelo fonte do Delphi percebi a criação de um array bidimencional.

Não sei como faria no centura para passar os parâmetros da funcção. Alguem
poderia me dar uma luz?

 

Abaixo segue o código Delphi que invoca o método.

 

Agradeço qualquer ajuda.

 

[[]]

 

Ledo

 

*************código Delphi******************

 

unit principal;

interface

uses

  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

  Dialogs, StdCtrls;

 

const

 dllNf = 'biblioteca.dll';

 

type

  ArrayBi = Array of Array of shortstring;

  TForm1 = class(TForm)

    Button1: TButton;

    Edit1: TEdit;

    Label1: TLabel;

    CheckBox1: TCheckBox;

    procedure Button1Click(Sender: TObject);

  private

    { Private declarations }

  public

    { Public declarations }

  end;

 

function GeraNF(ide : Array of shortstring; detProd : ArrayBi;assinar :
boolean = false) : shortstring; StdCall; External dllNf;

 

 

var

  Form1: TForm1;

 

implementation

 

{$R *.dfm}

 

procedure TForm1.Button1Click(Sender: TObject);

var

 tIde : array of shortstring;

 tProd : arraybi;

 x : integer;

begin

  SetLength(tIde,3);                                //ide

  SetLength(tProd, StrToInt(Edit1.Text), 3);        //prod

 

  for x:=0 to  (length(tProd)-1) do

  begin

   tProd[x,0]:='73181500';
//<NCM>

   tProd[x,1]:='MEU PRODUTO DE TESTE '+IntToStr(x+1)+' LEDO';      //<xProd>

   tProd[x,2]:='5102';
//<CFOP>

  end;

 

 

  GeraNF(tIde,tProd,CheckBox1.Checked);

 

 

 

end;

 

end.

Responder a