Solved

Progressbar in DLL

Posted on 2000-05-17
7
606 Views
Last Modified: 2010-04-04
Can anyone tell me how I can create a Delphi DLL with a progressbar in it that can be called by external programs. What I am really asking is how do I make the application the parent of the progressbar? please see further comment below.

TIA
0
Comment
Question by:MartinHodder
  • 3
  • 2
  • 2
7 Comments
 
LVL 3

Expert Comment

by:Slavak
ID: 2817384
just place it on form and show/hide the form when you need
0
 
LVL 1

Expert Comment

by:xsoft
ID: 2819305
Does your dll only contain a progressbar which you want to show on another control or form of the calling application, or does it contain a form which displays the prog.bar?
0
 

Author Comment

by:MartinHodder
ID: 2820303
The idea is the progress bar ( on a form ) can be compiled into a DLL then i am using a completely different programming language to use the DLL. I want the new application to be able to pass a window Handle and then the progress bar to use this window as a parent - so if I alt Tab out of the application the progressbar goes with it

Many thanks for your help with this

Martin
0
Industry Leaders: 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!

 

Author Comment

by:MartinHodder
ID: 2820304
Edited text of question.
0
 
LVL 3

Expert Comment

by:Slavak
ID: 2820739
Sorry, I cannot understand your problem.

Just create form, place progressbar on the form.

Make three functions :

procedure ShowProgressBar;
Begin
 ProgressBar.Position := 0;
 Form1.Show;
End;

procedure SetProgressBar(Pos, Max : Integer);
Begin
 ProgressBar.Max := Max;
 ProgressBar.Position := Pos;
End;

procedure HideProgressBar;
Begin
 Form1.Hide;
End;

export the functions from your dll.

You can add some changes, if you want have number of progressbars in same time, or "Cancel" button on it.


0
 
LVL 1

Accepted Solution

by:
xsoft earned 100 total points
ID: 2821112
You should export a function like this:

function ShowForm  (const App:integer):integer;

implemenation
function ShowForm  (const App:integer):integer;
var Frm:TMyForm;
begin  
if App<>0 then Application.Handle:=App;
  Frm:=TMyForm.Create(Application);
  try
    try
      Result:=FrmFind.ShowModal;
      if Result=mrOK then...
    except
      Result:=-1;
    end;
  finally
    Frm.Release;
  end;
end;

In your case I think you would not like to use ShowModal. Use the Show-method instead, hide the system menu etc. so that the user can't close your form.
Then add a function to update the progressbar as needed and a third function to close the form when you are done.
Don't forget to export all three functions.

HTH,

Thomas
0
 

Author Comment

by:MartinHodder
ID: 2821183
Thanks very much thomas I will go and try it

Regards

Martin
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

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…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

713 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