Solved

Progressbar in DLL

Posted on 2000-05-17
7
597 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
Comment Utility
just place it on form and show/hide the form when you need
0
 
LVL 1

Expert Comment

by:xsoft
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:MartinHodder
Comment Utility
Edited text of question.
0
 
LVL 3

Expert Comment

by:Slavak
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks very much thomas I will go and try it

Regards

Martin
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now