Solved

Installing Component

Posted on 2002-07-07
6
530 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 20 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

832 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