?
Solved

dll & application handlers

Posted on 2003-02-20
4
Medium Priority
?
196 Views
Last Modified: 2010-05-18
I am new with application handlers and have the following problem:

I am using using a dll for some more often used procedures. These functions include a form. Problem is that the form closes after completing the first procedure executed. Problem is that i dont want that, it has to be closed AFTER completing the procedure and AFTER i click a close button

programma code

[code ]

type
  TLibSIKBprotocolExportPakketten = procedure; stdcall;

..

procedure TForm1.Button1Click(Sender: TObject);
var
  LibHandle:THandle;
  CallExportAanvraagPakketten:TLibSIKBprotocolExportPakketten;
begin
  LibHandle:=LoadLibrary('PDlltest.dll');
  if LibHandle = 0 then
    ShowMessage('Kan PDlltest.dll niet laden');
  try
    CallExportAanvraagPakketten:=GetProcAddress(LibHandle,'ExportAanvraagPakketten');
    CallExportAanvraagPakketten;
  finally
    FreeLibrary(LibHandle);
  end;
end;

[/code]

dll code

[code ]

procedure ExportAanvraagPakketten; stdcall;
begin
  try
    FormAanvraagAnalysePakketten:=TFormAanvraagAnalysePakketten.Create(nil);
    try
      FormAanvraagAnalysePakketten.StartExportAnalysePakketten;
      FormAanvraagAnalysePakketten.close;
    finally
      FormAanvraagAnalysePakketten.Free;
    end;
  except on E: Exception do
    MessageDLg('De volgende fout is opgetreden:'+#10+
               E.Message +#10+
               'Foutcode: '+IntToStr(E.HelpContext),mtWarning,[mbOK],0);
  end;
end;

[/code]

I already heard that is has something to do with sending the application handler, but how to do this? Any help is appreciated.

0
Comment
Question by:irenicus
[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
 

Accepted Solution

by:
pderuiter earned 200 total points
ID: 7988491
you create the form, you start a procedure and then you CLOSE it again in the TRY. When you do that, it wont wait for a button click, but will close immediately after it finished StartExportAnalysePaketten.

or is it me?

You could also make it a modal form (i.e. use Form.showmodal) that way it will continue execution after you close it.
0
 

Expert Comment

by:CleanupPing
ID: 9317162
irenicus:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 10

Expert Comment

by:kacor
ID: 9928671
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to accept pderuiter's answer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Some days and here is the Christmas Time. I wish good luck and good health for you all and for your loved ones

kacor
EE Cleanup Volunteer
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

764 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