Link to home
Start Free TrialLog in
Avatar of ebi1
ebi1Flag for Israel

asked on

delete properties and methods...?

Hi all,

I'm using Delphi2 for something i want to be as SMALL as possible.

I'm using Delphi only as a hobby, so i'm not a pro...

I know almost nothing about OO.

Since i want my program to be VERY small, is it possible to delete properties and/or methods i don't use, and by doing so reducing the EXE size ?
Example :
I don't use the cursor and PopupMenu (and others) properties and everything related to them.
and from the "Dialogs" unit i ONLY use MessageBox (and of course i'm not talking only about the "Dialogs" unit)
So... can i delete what i DON'T need?

If it can be done please give me a GOOD example.

ThanX
Avatar of ebi1
ebi1
Flag of Israel image

ASKER

BTW : I use "Resource Hacker" and UPX (level 9) to reduce my EXE.

I have a Gouge, RxLib Animated GIF (24k), a few labels and a button.

Acording to what someone once told me - I use Frames instead of Panels to avoid the use of Handle (memory/size).

After all that i can't get my EXE file lower then 145k.

Please help.
ThanX
Avatar of ebi1

ASKER

BTW : I use "Resource Hacker" and UPX (level 9) to reduce my EXE.

I have a Gouge, RxLib Animated GIF (24k), a few labels and a button.

Acording to what someone once told me - I use Frames instead of Panels to avoid the use of Handle (memory/size).

After all that i can't get my EXE file lower then 145k.

Please help.
ThanX
Avatar of ebi1

ASKER

sorry i meant Bevel not frames...

Sorry about my English
Avatar of robert_marquardt
robert_marquardt

The best way is to completely drop the use of the VCL. There are free replacements out there which allow to drop EXE size considerably. Have a look at Torry's Pages and Delphi Super Page.
I often comment out things in my uses clause to see if they are needed

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, {Dialogs,} Buttons, StdCtrls;

if it will compile with the unit commented out then I delete it because it is no longer nessary. If you really want to get the smallest file size then you will need to do API without the Forms unit, but that takes time to learn, you can look at my web site to see if you want to try and do that

http://www.angelfire.com/hi5/delphizeus/

if you use the Forms unit, even with Delphi2 and the UPX you can't get much below 150 Kb. With API many programs are below 100 Kb and then below 50 KB with UPX.
Keep in mind that EXE size does not mean much to Windows. The memory footprint is quite another question.
EXEs are only loaded partly into memory. Using Quick Report for example easily makes 1.5 MB EXEs. Most of the code is not permanently loaded.
ASKER CERTIFIED SOLUTION
Avatar of Gwena
Gwena

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Where can I find UPX ? is it freeware ?

Regards
Adeng
here is one page addy for UPX a FREE .exe packer

http://upx.sourceforge.net/
UPX is great for single instance executables..

But remember that if your exe will have many instances running at the same time that each will occupy memory if it is compressed...when an exe is uncompressed all the instances will use the same original image in ram.

just something to keep in mind :-)
Avatar of ebi1

ASKER

Hey there,

Sorry about the delay guys, I totaly forgot about this question...

Nobody actualy answered my question but I never knew about the KOL so for me it's a BIG thing...

Thank you Gwena, helpful as always...   :)

Slick - you will also get some points because i learned many good things from your site.
Thank you