Solved

Runtime 216 y 217

Posted on 2000-04-26
4
176 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

773 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