Solved

compiled source code in the project

Posted on 2004-04-25
2
159 Views
Last Modified: 2010-07-27
Hello!

i have a small project that i have done and now   i have couple forms to it. I would like to have a

part of the project compiled within the form

i want to complie a code that is under FormActivate and leave all the rest s it is.

what i mean by that :

well i just want to make the part of the code under FormActivate be invisible or coded

so a person that would open the project ,  could not see the code that is under

FormActivate.

acepcca
0
Comment
Question by:acepcca
2 Comments
 
LVL 11

Accepted Solution

by:
shaneholmes earned 60 total points
ID: 10914515


You could wrape the functionality under the FormActivate into ints own routine, then add that routine to a separate unit
and then just provide them the DCU to that unit,  or compile that unit into a runtime package, and provide that instead of the code.....

SHane


Example

______________________________
Here is Main Form
______________________________

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
    procedure FormActivate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormActivate(Sender: TObject);
begin
 UpdateForm1Caption('Hello!');
end;

end.

__________________________________________________
Here Is Other Unit
__________________________________________________

unit Unit2;

interface

procedure UpdateForm1Caption(Cap: String);

implementation

uses Unit1;

procedure UpdateForm1Caption(Cap: String);
begin
 form1.Caption:= Cap;
end;
0
 
LVL 12

Expert Comment

by:Ivanov_G
ID: 10916263

   Shane's idea is correct

   procedure ProcessForm (TargetForm : TForm);
   begin
      with TargetForm do
         begin
            Color := clGray;
            Caption := 'Form1 Caption'
            Label1.Caption := 'bla-blabla';
            // and so on ...
         end;
   End;
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 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