?
Solved

Runtime 216 y 217

Posted on 2000-04-26
4
Medium Priority
?
179 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 100 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month11 days, 19 hours left to enroll

752 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