Pluralitas non est ponenda sine neccesitate. (Principle known as Occam's Razor) |
Why Windows applications so large and so fat?
Its very simple. All these contain too many code and
resources that are not really needed to provide its functionality. For example,
in Delphi we usually start new project with a single empty form. If we build
this project we can see that size of program that yet do nothing is already more
than 100K bytes. And it is only needed to provide some carcass and then during
further programming code will growing more. Finally, after creating something
sensible application that can do whatever You will got at least 300K bytes in
the best case! (Yes, I know, that after building it with run-time libraries
it is collapsing to several kilobytes, but using this method You need to
distribute at least one dpl or bpl file with size more than 1Mb with such "tiny"
application).
And why it is so? Why this unnecessary
code is attaching to application while building it? Because of linker (which is
existing in Delphi too) is attaching code of all units, which names are
referenced in already added units.
How to make small applications for Windows in Delphi?
Answer not too complex. First refuse from using VCL (and
Forms unit in particular). Use only Windows.pas, ShellAPI.pas and Messages.pas.
Call only API functions. If You want use some powered objects (lists,
stringlists, inifiles and so on) be careful. Test size of Your application
before and after including new unit to USES clause of Your project. If growing
is too big, refuse from it, and think: if You can not create similar unit with
only required functionality support? If You can, do it so. Do not afraid!
Windows API contain all You need. But...
Yes, I know it is
not convenient. Refusing from VCL and the most of powerful objects provided by
Delphi makes programming very hard and very slow. Often You already forgot (or
even did not know) about several API calls. If You started Your carrier in
Windows from Delphi, all these are hard twice. As a result You have to reduce
additional functionality of your small apps made without VCL, simplify their
behavior and got too poor code which without doubts looses in comparison with
similar Delphi powered applications - even in their exterior look.
How to create good programs without VCL?
All You need to create good programs is a good library of
objects suitable to provide You with all services You want to have. TObject
class is not bad basic to create clever objects that therefore do not need too
many code and keep Your program size in reasonable limits. Indeed, growing of
code when using VCL starts with TPersistent. This last is the ancestor class for
most of VCL components. It is intended to provide Delphi VCL components and
controls with ability to read their initial state from the form definition block
located in executable. Refusal of VCL is first of all refusal of TPersistent.
Because all components are descendents from TPersistent You can not use forms,
components and controls. But controls what You usually use are not the part of
Delphi. These all are part of Windows and Delphi only provides pleasing
object-oriented interface with them. It is possible to provide similar
object-oriented interface with all Windows controls such as button, label, edit,
toolbar, and so on by hand just creating correspondent object class. And if it
is programmed it can be re-usable not only by You but by anybody in the World. I
think that it is not work for single programmer. So...
Let us start XCL project and reduce code size of our applications!
By given document I (Mr.Bonanzas) declare start of OPEN FOR ALL eXtreme Class Library project. Anybody who wants to join this project can contact me. I will provide members list of this project on my WEB page (here). Anybody who have ideas, suggestions and necessary experience is invited.
Welcome to XCL!
![]() |
XCL is freeware at all. In part, this means that nobody can sell it for any kind of charge. Anybody can use it for creating products of any kind, including commercial software products without any restrictions. As it is said usually in License Warranty Agreement,
"In no event shall the
author be held liable for any damages whatsoever,including without limitation,
damages for loss of business profits,business interruption, loss of business
information, or any other loss arising from the use or inability to use the
software."
Yes, programming in XCL is non-visual process yet (like creating of new components in VCL). But now this is changing. Current project XCL Wizard which is intended to make programming with XCL classes VISUAL again, is in progress. And full functional release of XCL Wizard is coming very soon. Read more detailed about status of the project in Last News. And, now You can also get know more about XCL Wizard (basic concepts, iterface, tools) in a new article XCL Visual.
I can definitively say: NO. XCL controls even more power in some
cases. Moreover, XCL allows to solve of some problems of exterior in Delphi
applications, which could not be solved in VCL at all. E.g., it is a problem of
flickering, which can be solved in XCL using add-ons. And, it is a problem of
autosizing of forms (solved using add-ons) and proper scaling of those. And, it
is a problem of appearing/disappearing of scrollbars, problem of resizing of
thumb-button on scrollbars and problem of flickering of scrollbars. I can also
add here, that many problems, which are interesting for beginners (e.g.: how to
hide app from taskbar, how to rotate fonts, how to run only single instance of
the program, how to place icon on tray), can be solved in XCL much easier then
in VCL - just with one line of code.
Oh, I forgot to mention the
greatest problem - size of executable... In XCL it is solved too.
Last updated: 18.03.00
'eXtreme' because it consists of objects not components. So application made
with its can be eXtremely small.
'Class' because it is intended to provide
interface with standard Windows controls such as button, checkbox, listbox,
treeview, richedit and other Microsoft Foundation Class objects. Also it
provides similar objects which are not windowed and not based on MFC like
graphic controls in Delphi VCL. These all are needed to provide normal
programming environment and in most cases too overloaded in Delphi with code
which often are useless. For example, if You use TStringlist without sorting
possibility code which provide this unclaimed feature will be added in any case
and You can not refuse from it. And so on.
'Library' because it is must be
FREE for use by anybody in the World who want use it. All members of XCL project
must be agree what their code will be available with source for anybody who want
to use it (not end application - that is out of the question). Only in that case
still possible to improve this project and include new
members.
First, You have to get acquainted with agreements above. Then, You can download xcl.zip which contains XCL project sources at the current state. Then if You find it possible for You, join us (me)!
Look at the task list and choose kind of problem what You can solve. Then e-mail me. After joining Your name will appear in members list and in task list. After finishing task You choose another task and so on. But work what You finished sometimes may require Your attention. You have to stay responsible for all corrections in your code. If You can not continue work with XCL or become busy for a time but your code need to be fixed or improved this work can be re-entrusted to another member of our project. Remember, that our association is free and voluntary union of programmers who agree to listen up another opinions, take and give advises, make and receipt suggestions, take part in any discussions concerning this project.
XCL programming basic principles.
Any object designed for eXtreme Class Library must satisfy to the following concepts:
Here You can see members of XCL project and data what they
found possible be published about them. Also, in right columns You can see tasks
that are made by them and current job of every member if he(she) working under.
If You have questions or suggestions to particular member concerning task for
which he is responsible You may contact him(her) directly if e-mail is available
( if not, contact me ).
Names of base (usually abstract)
classes are italicized, end classes intended to use in applets have
bold names.
Member name |
Tasks finished |
Current task |
Vladimir Kladov (aka Mr.Bonanzas)
1st member |
XClass, XVisual ,
ZList, XWindow
(+XWindowsManager), XApplet (modified by
C.Kok),
XForm (+XFormsManager),
XFormAutoSizer, XControl,
XControlAutoPlacer, XGraphics.pas
(XPen, XBrush, XFont),
XCanvas (+XCanvasManager),
XCanvasObjectsManager, XControls.pas
(XCustomControl, XLabel, XCustomBevel,
XBevel, XPanel, XSplitPanel,
XStatus, XSplitSizer, XGrep, XGauge, XHysto, XGroup,
XPaint, XCustomCheckBox,
XCheckBox, XRadioBox,
XCustomCheck, XCheck, XRadio,
XCustomButton, XButton, XDropButton, XScroller,
XScrollBar, XScrollBox, XGrid, XListView, XTimer, XMenu,
XResizeAntiFlicker, XEdit (+4 add-ons),
XCombo; XMfcControl and its descendents: CCustomStatic, CLabel, CCustomPaint, CPaint, CPanel; ZDDB, ZHiBmp, ZDIBitmap, ZBitmap, ZIcon, ZGifDecoder, ZGif, ZJpeg, XTooltip, XCustomForm, XDsgnForm. |
always working under documentation; |
Tim Slusher
2nd member |
ZStream,
ZFileStream,
ZMemoryStream
(in XStreams.pas)
and correspondent changes in XFileUtils.pas,
XStrLists.pas,
ZRegistry (in XRegistry.pas). ZStrings, ZStringList in XStrLists.pas. CButton, CEdit, CMemo, CRadioButton, CCheckBox, CComboBox, CListBox in XMFCControls.pas. |
CRichEdit, ... ? |
C.Kok
3rd member |
Useful modifications of XApplets.pas
allowing to minimize/restore XCL applet using its taskbar button pop-up
(system) menu. Unit XDialogs.pas with Open/Save dialogs implementation. |
|
Dave Beseke
candidate |
Some good reports about bugs. | XCL + ActiveX |
Luke Guzsir (nick
GuX)
candidate |
Small bug fix for Delphi3: type definition LongWord in Classes.pas. | |
Nisses
Insane
candidate |
HELP for XCL ? | |
Howard Flank
associated |
HfUtils - set of string routines for strings to work with XCL. | |
Sergey Kashalov
(nick Gray)
associated |
Changes of some type declarations (integer to cardinal) and other, leading to fix bug #1 with incompatibility in IE5 environment (or may be with some Delphi builds? - V.K.) | |
Wei Bao
associated |
Idea of "skins" for XCL. | |
Jordan Russell
associated |
Fixing of "Bug#2" with autominimizing of an applet under Win95/98. | |
Your name here | Task for You | |
XCL.hlp, XGifClip; applets made in Delphi XCL, may be more? |
Here You can see list of
available problems to solve named 'tasks' (I moved it into separate html,
because this list became too big). If problem is solved or it is solving now
then name of member is appearing in right column of table below. Any
case name of task in left column is referred onto more detailed description of
this one in separate html (if such description is ready). You may click it to
read either project definition or final description if task finished. If You
feel that task list not full, feel free to e-mail me about it to suggest new
necessary task name and its brief and/or detailed
definitions.
Choose one of not allocated problems to
become a member or if You consider that task list is not complete, add your own
here. Feel Yourself free to use source of any solved task similar given to get a
template to solve any other. If You give task be remember that Your code must
satisfy to basic
principles of XCL project. E-mail me, if You are ready
to vote yourself as XCL developers team member.
Here You can see part of hierarchy tree with some of ready to use XCL controls.
Even if You are not a member, but just use or plan to use XCL in your work,
You may refer to this page using banner above. Just place it on your page with
reference to my page either
(1) by copying and pasting banner above onto your
page;
(2) or by inserting following html into your page html:
<a href=http://xcl.cjb.net" target="_blank"><img src="xcl_vs_vcl.gif" width=80 height=40 alt="XCL vs VCL. Let us make our Delphi programs small !" border=0></a> |
Now XCL Forum is open. You can go there and discuss XCL. Now it is empty, and waiting for your opinions, suggestions, questions, and so on.
Hm... May, be You want to leave message in my Guestbook?
Here You can read text stories about XCL. Written by me and may be not only by me. My experience in leterature (especially in English) is not too great, so I will gladly accept your remarks and corrections concerning English - please by e-mail.
Here You can download the newest version (1.80, 18-Mar-2000) of XCL in
XCL.ZIP
(~265K).
Here You can download set
of samples. I decided to store these in separate archive samples.zip
(~72K) starting from v1.60.
If You have no object files
deployed with Delphi5 in Extras folder, You can download its here (These are
necessary to compile projects with XJpegs.pas unit). Download:
jpegobjs.zip, ~100K.
XCL Help Generator v1.3. Unpack it into your $(Delphi)\Bin directory,
and You will always give access to the most fresh XCL Help (and now - directly
from XCL Wizard too). Download: xhelpgen.zip
(~56K). In current version of XCL (1.79) help is generated for about half of
units. I hope to finish commenting all other ones soon.
XCL WIZARD
Below are three parts of XCL Wizard v0.92-0.93 (beta) for D3, D4
and D5. To install it, You also have to download new version of XCL v1.77(or
higher) above.
Note: v1.93 has changes only in XDesigner and XLib.
Supplements.
HfUtils by
Howard Flank with a set of useful string functions to use with XCL (and with
Delphi VCL too). Supplied here "as is" in zip
(~5K).
This article is created to place here links to downloadable applets created using XCL. If You, readers, used XCL to create some small utilities, which could be useful for other people, please e-mail me and I will place here either archive with your utility, or link to download it elsewhere from the Internet/FTP. And may be, link to your page.
![]() |
![]()
|
![]() |
![]()
|
![]() |
![]()
|
![]() |
![]()
|
I found that some developers can not immediately get desirable effect of reducing executable by using XCL or even compile project without errors. May be it is because they did not pay attention to some important info. May be it is because such info is located by parts in different places of this documentation. Here I will try to concentrate references to such significant info, calling its as 'lessons'.
Register below, and You will receive a message into your mail-box every time than this page is updated.
XCL Idea: (C) 1999-2000 by Vladimir Kladov