Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Installing Component

Posted on 2002-07-07
6
Medium Priority
?
546 Views
Last Modified: 2008-02-01
I'm trying to make my first component. I grabbed a simple example to test. (as below).  

I don't understand how I make this an available component on the pallette.  The steps I tried were as follows:
1) Copied the two files into the lib directory
2) component => install component
3)select the .pas file in the unitname box.
4) click the compile button on the DCL50 dialog

Everything appears to work but the component isn't added or visible.  

I must be missing out something really simple.

Any help would be appreciated
Thanks

code is:
{
Copyright © 1999 by Delphi 5 Developer's Guide - Xavier Pacheco and Steve Teixeira
}

unit PwDlg;

interface

uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
  Buttons;

type

  TPasswordDlg = class(TForm)
    Label1: TLabel;
    Password: TEdit;
    OKBtn: TButton;
    CancelBtn: TButton;
  end;

  { Now declare the wrapper component. }
  TddgPasswordDialog = class(TComponent)
  private
    PassWordDlg: TPasswordDlg; // TPassWordDlg instance
    FPassWord: String;         // Place holder for the password
  public
    function Execute: Boolean; // Function to launch the dialog
  published
    property PassWord: String read FPassword write FPassword;
  end;

implementation
{$R *.DFM}

function TddgPasswordDialog.Execute: Boolean;
begin
  { Create a TPasswordDlg instance }
  PasswordDlg := TPasswordDlg.Create(Application);
  try
    Result := False;  // Initialize the result to false
    { Show the dialog and return true if the password
      is correct. }
    if PasswordDlg.ShowModal = mrOk then
      Result := PasswordDlg.Password.Text = FPassword;
  finally
    PasswordDlg.Free;  // Free instance of PasswordDlg
  end;
end;

end.
0
Comment
Question by:winsor_andrew
  • 2
  • 2
  • 2
6 Comments
 
LVL 9

Accepted Solution

by:
ginsonic earned 80 total points
ID: 7136807
You forgot to add Register procedure.


..............
procedure Register;

implementation
{$R *.DFM}
...............
procedure Register;
begin
  RegisterComponents('MyWork', [TddgPasswordDialog]);
end;

0
 

Author Comment

by:winsor_andrew
ID: 7136839
Thanks, thought it would be something simple.
0
 
LVL 9

Expert Comment

by:ginsonic
ID: 7137489
Whay a C grade?
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.

 

Expert Comment

by:ComTech
ID: 7137566
Hello winsor_andrew, you thought it would be someting simple. thoes are your words.  And since the Expert took the difficulty of time to produce these results, I do not understand a C grade.  An answer is an answer whether or not it turns out the way you might like.

Since I believe this to be the case, I will change the grade.  This will help you both, it doesn't cost you any more points and most top Experts will look at your grading record, as they work hard to help, and are non-paid volunteers.  That is part of what makes the site so unique.

Regards,
ComTech
CS Admin @ EE
0
 

Expert Comment

by:ComTech
ID: 7137570
If you feel I am in error, please contact Community Support regarding this matter.

CT
0
 

Author Comment

by:winsor_andrew
ID: 7139124
Sorry, first time I've posted a question and not quite sure about the grading part.  Understand a bit better now thanks.
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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

783 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