Solved

Runtime 216 y 217

Posted on 2000-04-26
4
177 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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