?
Solved

Progressbar in DLL

Posted on 2000-05-17
7
Medium Priority
?
619 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses
Course of the Month10 days, 14 hours left to enroll

770 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