Solved

compiled source code in the project

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now