Solved

Progressbar in DLL

Posted on 2000-05-17
7
611 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
[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
  • 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
Technology Partners: 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

Technology Partners: 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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

737 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