Solved

Runtime 216 y 217

Posted on 2000-04-26
4
174 Views
Last Modified: 2010-04-04
Saludos,
Tengo una aplicacion que reliza una llamada a una dll, la ejecucion se realiza sin problemas, pero al tratar de salir de la aplicacion me devuelve siempre mensajes de error Runtime 216 y 217 y la unica manera de cancelarlo es por medio del task/manager de windows nt.
La aplicacion que estoy utilizando es:

unit Unit2;

interface

uses
  Sharemem, Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Operacion: TEdit;
    Longitud: TEdit;
    Pan: TEdit;
    Pin: TEdit;
    Offset: TEdit;
    Epin: TEdit;
    Tpin: TEdit;
    Resultado: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

  function Key_Manager(var Operacion,Longitud,Pan,Pin,Offset,Epin,Tpin,Result_Code : string) : integer; stdcall;

implementation

  function Key_Manager; External 'Key_Manager_Dll.dll' name 'Key_Manager';

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
s : Integer;
s1,s2,s3,s4,s5,s6,s7,s8 : String;
begin

s1 := Operacion.Text;
s2 := Longitud.Text;
s3 := Pan.Text;
s4 := Pin.Text;
s5 := Offset.Text;
s6 := Epin.Text;
s7 := TPin.Text;
s8 := Resultado.Text;

s := Key_Manager(s1,s2,s3,s4,s5,s6,s7,s8);

Operacion.text := Copy(s1,1,2);
Longitud.text  := Copy(s2,1,2);
Pan.text       := Copy(s3,1,16);
Pin.text       := '0000';  //Copy(s4,1,4);
Offset.text    := Copy(s5,1,4);
Epin.text      := Copy(s6,1,16);
TPin.text      := Copy(s7,1,16);
Resultado.text := Copy(s8,1,4);


end;

procedure TForm1.Button2Click(Sender: TObject);
begin
   close;
end;

end.


Agradeceria todos los comentarios que me puedan ayudar a resolver este problema.


Gracias.
0
Comment
Question by:rbarzallo
4 Comments
 
LVL 3

Accepted Solution

by:
shenqw earned 25 total points
ID: 2752727
In your Project source code and you Dll source code. Add ShareMem in the first Uses.
0
 
LVL 3

Expert Comment

by:bryan7
ID: 2753211
rbarzallo.. may I know where you are from ?
0
 
LVL 4

Expert Comment

by:Radler
ID: 2753420
Hi rbarzallo,

I saw ( var param_names, ..... : string ) : ResultType;
The called method was made in Delphi too ?( same version ? );
The best pratice is replace the implementation to
DLLMethod( const param_Names, ..... : PChar ) : ResultType;
More details carent your DLL code. And kidding - more points :-)

T++, Radler.
0
 

Author Comment

by:rbarzallo
ID: 2753853
Thanks,

I'm from Guayaquil, Ecuador

Saludos
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now