Thema: Delphi DFM-Datei binär?

Einzelnen Beitrag anzeigen

Benutzerbild von MaBuSE
MaBuSE

Registriert seit: 23. Sep 2002
Ort: Frankfurt am Main (in der Nähe)
1.840 Beiträge
 
Delphi 10 Seattle Enterprise
 
#5

Re: DFM-Datei binär?

  Alt 25. Feb 2005, 13:49
Zitat von alcaeus:
ich habe hier eine dfm-Datei welche wohl Binär abgespeichert wird. Mein Delphi kann die Datei ganz normal lesen, aber auf einem anderen Computer kommt immer die Fehlermeldung "Invalid stream format".
Diese Fehlermeldung kommt normalerweise nur wenn eine "ältere" Delphi Version das Binärformat einer "neueren" Delphi Format versucht zu lesen. (z.B. binäre D7 Dfm in D5 öffnen)
"Neuere" Delphi Versionen sollten aber immer noch das binäre Format der "älteren" Delphi Versionen lesen können.

Für dieses Problem gibt es das Tool DFMCleaner in der JVCL (jvcl\devtools\DFMCleaner)

dc.txt
DFMCleaner is a tool to remove unsupported properties from DFMs. If you save a dfm file in one version of Delphi and want to use it in an earlier version, chances are there are some unsupported properties in it, generating an error when the form is opened in Delphi. What's even worse, if the dfm is part of a design-time package, Delphi will install the package without errors but when you try to access the form at design-time (f ex if the form is used by a property editor), Delphi generates an AV instead.

Command-line:

dc.exe <options> <filemask> <filemask>

where <options> can be:
-i - replace in-line (output overwrites input). If not given, output uses input's filename but with a "txt" extension
-s - recurse into sub-folders
-f<filename> - read skiplist from <filename>, REQUIRED. Do not preceed filename with spaces!

<filemask> can be a filename or a filemask with wildcards. Also supports relative paths (like ..\source\*.dfm and source\*.dfm). Filemasks that contain spaces must be enclosed in single or double quotes

The output file is only written if it is different from the input. Input DFM's can be in either text or binary format but the output is always written in text format.

The skiplist has the following format:
Each row contains the name of a property to remove, preceeded by it's classname or a "*". A "*" means "any class".
Examples:
*.DesignSize - remove all DesignSize properties
TPageControl.TabIndex - remove TabIndex for TPageControl

Note that the tool cannot derive inheritance from the dfm, so all affected classes must be named explicitly, i.e if you want to remove TabIndex for TPageControl and all descendants, you must name them on one row each:
TPageControl.TabIndex
TJvPageControl.TabIndex
TPageControlEx.TabIndex
etc...

The skiplist file doesn't have to be sorted: it is sorted internally.
(°¿°) MaBuSE - proud to be a DP member
(°¿°) MaBuSE - proud to be a "Rüsselmops" ;-)
  Mit Zitat antworten Zitat