Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Progressbar in DLL

Posted on 2000-05-17
7
Medium Priority
?
622 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
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 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

636 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