Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

delphi without dfm

849 views
Skip to first unread message

Maziar Navahan

unread,
Apr 23, 2008, 11:00:41 PM4/23/08
to
Hi all

i need tools convert dfm form to code only pas describe all of need of me
have delphi this feture in next ?
have any tools convert dfm resource to code ?


Ain Valtin

unread,
Apr 24, 2008, 12:24:23 PM4/24/08
to

GExperts do have "Components to code" expert.
http://gexperts.org/

HTH
ain

Maziar Navahan

unread,
Apr 24, 2008, 12:12:47 AM4/24/08
to
but
i need tools Complete convert all controls and props with create .... to pas
unit !
and also after change dfm update its ...

"Ain Valtin" <@i...@taavi.ee> wrote in message
news:4810b3ed....@newsgroups.borland.com...

Rudy Velthuis [TeamB]

unread,
Apr 24, 2008, 2:03:02 PM4/24/08
to
Maziar Navahan wrote:

> but
> i need tools Complete convert all controls and props with create ....
> to pas unit ! and also after change dfm update its ...

I don't think such a tool exists, since it would have to be two-way,
more or less like the WinForms designer in Visual Studio, and the VCL
simply works differently, using a .dfm.

But I'd like to know why you don't want to use .dfm files. What is
wrong with them?

--
Rudy Velthuis [TeamB] http://www.teamb.com

"It was the experience of mystery -- even if mixed with fear --
that engendered religion."
-- Albert Einstein (1879-1955)

Tom Corey

unread,
Apr 24, 2008, 2:42:37 PM4/24/08
to
Rudy Velthuis [TeamB] wrote:

> But I'd like to know why you don't want to use .dfm files. What is
> wrong with them?

I have the impression that he's got a DFM created the usual design-time
visual way, and now instead wants to create it entirely in code at
run-time. Easy enough to do by hand for a few simple forms, but if he's
got a bunch of complex forms it would be pretty tedious to do manually.

Maziar Navahan

unread,
Apr 24, 2008, 2:20:40 AM4/24/08
to
yes do same

but very nice one tools do it for sample

" Tom Corey" <omtay....@otmailhay.omcay> wrote in message
news:xn0fpbdcj...@newsgroups.borland.com...

Cody Skidmore

unread,
Apr 24, 2008, 3:10:15 PM4/24/08
to
Maziar Navahan wrote:
> yes do same
>
> but very nice one tools do it for sample

You may as well find a different different development tool. You'll end
up fighting Delphi all the way.

Marc Rohloff [TeamB]

unread,
Apr 24, 2008, 4:52:36 PM4/24/08
to
On Wed, 23 Apr 2008 23:20:40 -0700, Maziar Navahan wrote:

> but very nice one tools do it for sample

You could use DFMEdit to convert a DFM file to code
http://sourceforge.net/projects/dfmedit/

--
Marc Rohloff [TeamB]
marc -at- marc rohloff -dot- com

Rudy Velthuis [TeamB]

unread,
Apr 24, 2008, 6:21:24 PM4/24/08
to
Cody Skidmore wrote:

Exactly. And he still didn't say why.

--
Rudy Velthuis [TeamB] http://www.teamb.com

"I'll moider da bum."
-- Heavyweight boxer Tony Galento, when asked what he thought of
William Shakespeare

Rudy Velthuis [TeamB]

unread,
Apr 24, 2008, 6:20:48 PM4/24/08
to
Tom Corey wrote:

> Rudy Velthuis [TeamB] wrote:
>
> > But I'd like to know why you don't want to use .dfm files. What is
> > wrong with them?
>
> I have the impression that he's got a DFM created the usual
> design-time visual way, and now instead wants to create it entirely
> in code at run-time.

I understood that. And that is possible. But he wants changes to the
design to be reflected in the code, and I don't think there is a tool
that does that, for the VCL.

I just wonder why he wants that.

--
Rudy Velthuis [TeamB] http://www.teamb.com

"The de facto role of the US armed forces will be to keep the
world safe for our economy and open to our cultural assault."
-- Major Ralph Peters, US Military

Gil

unread,
Apr 24, 2008, 6:28:55 PM4/24/08
to
He may want to port his code to FPC, nothing wrong with that.


Rudy Velthuis [TeamB]

unread,
Apr 24, 2008, 6:44:41 PM4/24/08
to
Gil wrote:

> He may want to port his code to FPC, nothing wrong with that.

Nothing wrong with that, indeed. I was just wondering why he wanted it.
But AFAIUI, he wants changes to be reflected in code too, so I assume
he still wants to use the Delphi designer.

--
Rudy Velthuis [TeamB] http://www.teamb.com

"God gave men both a penis and a brain, but unfortunately not
enough blood supply to run both at the same time."
-- Robin Williams, commenting on the Clinton/Lewinsky affair

Alexandre Machado

unread,
Apr 24, 2008, 8:09:43 PM4/24/08
to
> I just wonder why he wants that.

Me too. The only thing that occurred to me is obfuscation.
Extract all forms from a Delphi EXE is pretty easy. Thats how most Delphi
"decompilers" work.

Regards


Maziar Navahan

unread,
Apr 24, 2008, 9:13:47 AM4/24/08
to
nice tools


"Marc Rohloff [TeamB]" <ma...@nospam.marcrohloff.com> wrote in message
news:z406o41l...@dlg.marcrohloff.com...

Maziar Navahan

unread,
Apr 24, 2008, 9:13:34 AM4/24/08
to
easy :

1.first i need all out of design time i now create own framework load
design of big application from db and one genrator design visual section in
runtime
for ERP system is nice idea
bit yet many "dialogs design in desgin time"
4th softwate eng.

"Rudy Velthuis [TeamB]" <newsg...@rvelthuis.de> wrote in message
news:xn0fpc6u077orn...@rvelthuis.de...

Gil

unread,
Apr 24, 2008, 11:16:29 PM4/24/08
to

> But AFAIUI, he wants changes to be reflected in code too, so I assume
> he still wants to use the Delphi designer.
>

it may be a feature request then.


Gil

unread,
Apr 24, 2008, 11:21:14 PM4/24/08
to
BTW it would make Delphi code multiplatform if it could export projects to
FPC


Gerard

unread,
Apr 25, 2008, 4:21:10 AM4/25/08
to
En/na Gil ha escrit:

> He may want to port his code to FPC, nothing wrong with that.
>
>
If you mean Lazarus, it works on a similar basis as Delphi. Dfm files
are lfm's, and there is a dfm to lfm converter in the Tools menu of the
IDE, iirc.

Arthur Hoornweg

unread,
Apr 25, 2008, 7:03:57 AM4/25/08
to
Alexandre Machado wrote:
> Me too. The only thing that occurred to me is obfuscation.
> Extract all forms from a Delphi EXE is pretty easy. Thats how most Delphi
> "decompilers" work.

Yes, it's disturbing how easy that is. Everything is plain text, even
the names of event handlers.

I would love to have some better DFM protection built into
the VCL. Compression, encryption, obfuscation, whatever.

--
Arthur Hoornweg

(In order to reply per e-mail, please just remove the ".net"
from my e-mail address. Leave the rest of the address intact
including the "antispam" part. I had to take this measure to
counteract unsollicited mail.)

Graeme Geldenhuys

unread,
Apr 25, 2008, 8:27:57 AM4/25/08
to

GExperts will convert components or you. In conjunction with that, it
should be relatively easy to port VCL/Delphi the UI Designer (visual
forms designer) I wrote for my fpGUI Toolkit. It allows you to edit
forms visually, but updates the .pas unit for you. No .dfm files,
simply one .pas unit.

The UI Designer was not designer to be very complex, but simply speed up
the GUI design of applications and writes the code for you.
Also, the fpGUI UI Designer can handle 'unknown' components and
properties with grace (no crashing or not being able to parse the code).
The designer has a special 'TfpgUnknown' component on the component
palette for those.
It can also handle multiple forms in a single .pas unit.

See my website below for details and a screenshot of the UI Designer in
action. The UI Designer code is located in the fpGUI source repository
(trunk/examples/apps/uidesigner/)


Regards,
- Graeme -


_______________________________________________________
fpGUI - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/

Graeme Geldenhuys

unread,
Apr 25, 2008, 8:20:19 AM4/25/08
to
Rudy Velthuis [TeamB] wrote:
> But I'd like to know why you don't want to use .dfm files. What is
> wrong with them?

I made that design choice for my fpGUI Toolkit (VCL alternative). I
wrote a simple UI Designer to help design forms, and write the actual
code in the .pas file. It does it much quicker than doing it manually by
hand.

Benefits for me, not having a .dfm file:

* One less file to commit into a source code repository
* You can search and replace UI and business logic code.
* All settings are easily accessible in the source editor, no need to
switch to a Forms Designer simply to change a property value.
* No more accidental deleting of a component on the UI Designer and
loosing or that components customised settings as well.

Graeme Geldenhuys

unread,
Apr 25, 2008, 9:06:36 AM4/25/08
to
Marc Rohloff [TeamB] wrote:
>
> * Components fields can be defined as private or protected to control
> access from outside the class.

Exactly! I missed your reply by one minute. :-)

Graeme Geldenhuys

unread,
Apr 25, 2008, 9:05:38 AM4/25/08
to
Graeme Geldenhuys wrote:
> Benefits for me, not having a .dfm file:
>
> * One less file to commit into a source code repository
> * You can search and replace UI and business logic code.
> * All settings are easily accessible in the source editor, no need to
> switch to a Forms Designer simply to change a property value.
> * No more accidental deleting of a component on the UI Designer and
> loosing or that components customised settings as well.

...and...

* GUI components can be defined in the private or protected section of a
form class. When using .dfm files all gui components must always be
defined as Published (not very OO friendly).

Marc Rohloff [TeamB]

unread,
Apr 25, 2008, 9:04:14 AM4/25/08
to
On Fri, 25 Apr 2008 14:20:19 +0200, Graeme Geldenhuys wrote:

> Benefits for me, not having a .dfm file:
>
> * One less file to commit into a source code repository
> * You can search and replace UI and business logic code.
> * All settings are easily accessible in the source editor, no need to
> switch to a Forms Designer simply to change a property value.
> * No more accidental deleting of a component on the UI Designer and
> loosing or that components customised settings as well.

* Components fields can be defined as private or protected to control


access from outside the class.

--

Yogi Yang 007

unread,
Apr 25, 2008, 9:10:26 AM4/25/08
to
I found a utility for creating applicaton in Delphi without dfm but it
does not support VCL. But any way do check it. It may come handy at
times! http://mrhx.clan.su/

Probably this may also help you
http://www.felix-colibri.com/papers/colibri_utilities/dfm_parser/dfm_parser.html
http://www.felix-colibri.com/papers/colibri_utilities/component_to_code/component_to_code.html

Maziar Navahan

unread,
Apr 24, 2008, 8:57:11 PM4/24/08
to
but how compile it by delphi ?

"Graeme Geldenhuys" <gra...@spamfilter.co.za> wrote in message
news:4811...@newsgroups.borland.com...

Maziar Navahan

unread,
Apr 24, 2008, 9:00:47 PM4/24/08
to
nice and some help me BUT
nice if i have other component can convert inverse also code to dfm to
better action with delphi ,,,,

"Yogi Yang 007" <yogiy...@gmail.com> wrote in message
news:4811...@newsgroups.borland.com...

Ain Valtin

unread,
Apr 25, 2008, 10:04:52 AM4/25/08
to
On Fri, 25 Apr 2008 14:20:19 +0200, Graeme Geldenhuys
<gra...@spamfilter.co.za> wrote:

>Benefits for me, not having a .dfm file:
>
>* One less file to commit into a source code repository
>* You can search and replace UI and business logic code.
>* All settings are easily accessible in the source editor, no need to
>switch to a Forms Designer simply to change a property value.
>* No more accidental deleting of a component on the UI Designer and
>loosing or that components customised settings as well.

* When new version introduces a new property and you try to compile it
under older version you'll get compiletime exception not runtime one
as with dfm


ain

Gil

unread,
Apr 25, 2008, 10:28:18 AM4/25/08
to
Lazarus may work the same way as Delphi but FPC by it self may not support
dfm or ifm resources.


Francisco Sanchez

unread,
Apr 25, 2008, 10:32:07 AM4/25/08
to
Hi,

we have a library which does exactly that: compresses, encrypts and
obfuscates dfms. It's called Citadel (http://www.billeniumsoft.com)

> Yes, it's disturbing how easy that is. Everything is plain text, even
> the names of event handlers.
>
> I would love to have some better DFM protection built into
> the VCL. Compression, encryption, obfuscation, whatever.

Regards,
Francisco Sanchez
fsanchezR...@billeniumsoft.com
http://www.billeniumsoft.com

Gerard

unread,
Apr 25, 2008, 12:31:50 PM4/25/08
to
En/na Gil ha escrit:

> Lazarus may work the same way as Delphi but FPC by it self may not support
> dfm or ifm resources.
>
What compiler do you think Lazarus use to compile the LCL?

Alexandre Machado

unread,
Apr 25, 2008, 9:35:14 PM4/25/08
to
>> Me too. The only thing that occurred to me is obfuscation.
>> Extract all forms from a Delphi EXE is pretty easy. Thats how most Delphi
>> "decompilers" work.
>
> Yes, it's disturbing how easy that is. Everything is plain text, even
> the names of event handlers.
>

The less you know Delphi, the easier is to reverse engineer the exe. I have
done it at least 2 times: There was no code, everything was done inside a
component. That way, it is really easy to reverse engineer some software.

Regards.


Rudy Velthuis [TeamB]

unread,
Apr 26, 2008, 7:56:43 AM4/26/08
to
Maziar Navahan wrote:

> easy :
>
> 1.first i need all out of design time i now create own framework load
> design of big application from db and one genrator design visual
> section in runtime for ERP system is nice idea bit yet many "dialogs
> design in desgin time" 4th softwate eng.

I'm not sure what to respond, since I didn't understand the above.


--
Rudy Velthuis [TeamB] http://www.teamb.com

"There is no idea so simple and powerful that you can't get
zillions of people to misunderstand it." -- Alan Kay

L

unread,
Apr 26, 2008, 5:41:05 PM4/26/08
to
Maziar Navahan wrote:
> Hi all
>
> i need tools convert dfm form to code only pas describe all of need of me
> have delphi this feture in next ?
> have any tools convert dfm resource to code ?
>
>

KOL/MCK uses no DFM files and taps into delphi to create coded INCLUDE
files that contain the code for the forms.

However, KOL/MCK uses ugly IFDEF tricks ;-)


http://kolmck.net/

Farshad

unread,
Apr 27, 2008, 6:18:48 AM4/27/08
to

"Rudy Velthuis [TeamB]"

> Maziar Navahan wrote:
>
>> easy :
>>
>> 1.first i need all out of design time i now create own framework load
>> design of big application from db and one genrator design visual
>> section in runtime for ERP system is nice idea bit yet many "dialogs
>> design in desgin time" 4th softwate eng.
>
> I'm not sure what to respond, since I didn't understand the above.

From what I understand I thinks that he wants to generate Forms in runtime
from .dfm files which are saved in a db table. But I don't understand in
what way it can be useful for him. It is possible to create a delphi Forms
in runtime using dfm files, but what about the event handlers? What is he
going to do with a Form that contains controls without event-handlers
attached to them?


Robert Giesecke

unread,
Apr 27, 2008, 6:29:32 AM4/27/08
to
Farshad wrote:
> "Rudy Velthuis [TeamB]"
>> Maziar Navahan wrote:
>>
>>> easy :
>>>
>>> 1.first i need all out of design time i now create own framework load
>>> design of big application from db and one genrator design visual
>>> section in runtime for ERP system is nice idea bit yet many "dialogs
>>> design in desgin time" 4th softwate eng.
>> I'm not sure what to respond, since I didn't understand the above.
>
> From what I understand I thinks that he wants to generate Forms in runtime
> from .dfm files which are saved in a db table... but what about the event handlers? What is he

> going to do with a Form that contains controls without event-handlers
> attached to them?
>
>

He could pre-process the DFMs, extract the eventhandler names and kinda bind them to RPC calls.
BUT, doing this in Delphi is just sooo thick. Seriously, this is an example of seomthing where you
have to work work a bit more once and reuse it all the time.
Why not do it with Java and have it run on all platforms? What Delphi does with it's DFMs is *not*
rocket science, far from it actually.
One can easily redo it for Java for the Eclipse RCP or the Netbeans framework or based on plain Swing...
Or XUL, heck XUL is exactly what he wants. And he can even include the eventhandler code as JavaScript
if he wants! (The XUL Runner application is cross platform and you even get its security updates for free)
Tying this kind of metadata-driven client to Windows, just because one happened to use a Windows-only
tool before, doesn't make any sense, IMO.

Farshad

unread,
Apr 27, 2008, 8:53:04 AM4/27/08
to

"Robert Giesecke"

> He could pre-process the DFMs, extract the eventhandler names and kinda
> bind them to RPC calls.
> BUT, doing this in Delphi is just sooo thick. Seriously, this is an
> example of seomthing where you have to work work a bit more once and reuse
> it all the time.
> Why not do it with Java and have it run on all platforms? What Delphi does
> with it's DFMs is *not* rocket science, far from it actually.
> One can easily redo it for Java for the Eclipse RCP or the Netbeans
> framework or based on plain Swing...
> Or XUL, heck XUL is exactly what he wants. And he can even include the
> eventhandler code as JavaScript if he wants! (The XUL Runner application
> is cross platform and you even get its security updates for free)
> Tying this kind of metadata-driven client to Windows, just because one
> happened to use a Windows-only tool before, doesn't make any sense, IMO.

Actually, that's something I was thinking about for a long time: A Delphi
app which can be modified dynamically. There are many scripting tools for
Delphi, run-time form designers and etc. Also I know that there are people
that write big apps using tools like PascalScript, ScriptStudio and etc.One
need to gather all these and create something like an Application Builder
for Delphi. In http://www.greatis.com/ there are tools for runtime Form
designing which can be integrated with runtime Scripting tools. I don't
know how mature these products are but personally I'm seriously
investigating all possible ways to transform my application from static to
dynamic. I'm tired off deploying a new .exe each time customer wants even a
minor change in application logic.


Graeme Geldenhuys

unread,
Apr 29, 2008, 6:19:50 AM4/29/08
to
Maziar Navahan wrote:
> but how compile it by delphi ?
>

As I said, it was designed for the Free Pascal compiler (FPC). FPC is
pretty close to Delphi. And yes you would need to modify the UI Designer
to use VCL instead of fpGUI, but it should not be that hard.

Arthur Hoornweg

unread,
May 5, 2008, 8:02:16 AM5/5/08
to
Francisco Sanchez wrote:

> Hi,
>
> we have a library which does exactly that: compresses, encrypts and
> obfuscates dfms. It's called Citadel (http://www.billeniumsoft.com)

Very Interesting.

Are there any known issues (Vista etc)?
Can the component be used for encrypting other resources (such as bitmaps,
incorporated into the executable using $R) as well?

Also, I notice the latest version is for Delphi 2006, not 2007.
Will this component also support Delphi 2008 etc?

Francisco Sanchez

unread,
May 5, 2008, 10:09:46 AM5/5/08
to
> Are there any known issues (Vista etc)?

As the dfms are modified you can't just directly read them by using
Windows API resource methods. You must rely on Delphi's standard form
loading. I have only seen a localization library and an exception
manager doing that. The last one is now compatible because it was
possible to identify the forms it needs to read so they are not
processed by Citadel.

Another problem is when a dfm is read before initializing Citadel. That
may only happen if you load a dfm inside an initialization section and
you can fix it but making sure Citadel's unit appears in front of the
offending unit. Again, I can only recall one library which causes that.

> Can the component be used for encrypting other resources (such as bitmaps,
> incorporated into the executable using $R) as well?

No.

> Also, I notice the latest version is for Delphi 2006, not 2007.

You can use Citadel's D2006 packages under D2007.

> Will this component also support Delphi 2008 etc?

That's my intention.

Arthur Hoornweg

unread,
May 7, 2008, 4:25:39 AM5/7/08
to
OK, I just placed an order.

The SWREG website says it'll require manual authorization from your side,
don't know why.

0 new messages