Solved

compiled source code in the project

Posted on 2004-04-25
2
155 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

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.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 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