

TIniFile writes data into the INI file either explicitly by calling UpdateFile or implicitly when the destructor is called. On non-Windows platforms, TIniFile is a subclass of TMemIniFile that has the AutoSave property always set to True. TMemIniFile is a related object that works the same way as TIniFile, but the buffer writes in memory to minimize disk access. Note: If you want to minimize the disk access, use TMemIniFile.
#Delphi xe findinfiles windows
On Windows platform, TIniFile is inherited from TCustomIniFile and uses the Windows API. Keys take the form:Ī FileName is passed to the TIniFile constructor and identifies the INI file that the object accesses. Within each section, actual data values are stored in named keys. An INI file stores information in logical groupings, called "sections". TIniFile enables handling the storage and retrieval of application-specific information and settings in a standard INI file. I hope this article gets you started on Delphi’s DCP-File.TIniFile stores and retrieves application-specific information and settings from INI files. I just looped with a pattern of 60 Bytes here, that’s why i have an extra character here in front of the last name. Something to note here: The last entry, which is the DPK-Entry seems to have a Header with a length of 61.

So if you’ve done everything right, you can get an output like this: The last element is always the Package-DPK unit. So to get a list of contained units here, you simply skipp 60 Bytes and read 2 strings per element based on the number of contained units in our header. I highlighted theses fields in Green/Brown and Blue/Orange. This pattern goes on with units like “”, where the NameSpace is “Foo.Bar”. But when your unit is dotted like “Foo.OtherUnit”, it’ll contain “Foo”. When your unit is not dotted, the second string is always empty and consists only of the NULL-Character. The first string is our Unit-Name, the second one seems to be some kind of NameSpace. And 2 zero-terminated strings after each block. To sum it up here, each element of this list contains of a 60 Byte-Blob i haven’t investigated, yet. After that, a list of contained units with their own header follows. So to get a list of required DCPs, you simply read zero-terminated string after zero-terminated string based on the number of required DCPs as noted in our header. This is because it is directly followed by a list of zero-terminated strings which include the names of required DCPs. Right after our BPL-Name, we’ll notice “RTL”. So to sum it up, our header looks like this in Delphi: The Orange box simply contains the lengths in Bytes of the BPL-Name which follows the header (Excluding the terminating NULL-Character). Wait, we have to units, why does it tell me that there are 3? Quite simple, the DPK-File of your Package (In this case TestPackage.dpk) is included in this list, too. By fiddling around, you’ll notice that Green is the number of required DCPs and Blue the number of Contained Units. Green and Blue contain numbers, which change depending on the Number of contained Units and required DCPs. The Red-Field is our Signature as discussed before. I have outline the fields i already analyzed and describe them here. So our first 32 Bytes are for sure some kind of Header. By comparing different DCPs, you’ll notice, that the BPL-Name always starts at the same position (Byte 33). And this is the place where you’ll find the final BPL-Name. For example, for VCL150.bpl only a VCL.dcp exists. This is required when dealing with BPLs which have Postfixes. This is the name fo the BPL the linker will link to. YOu may validate this when loading a file to make sure you have a DCP. All DCP seem to start with it, so i declared it as our DCP-Signature. Something you’ll notice is, that the Stream starts with the 4 AnsiChars “PKX0”. Use VCL Styles at design time Prototype stylish UIs even faster by seeing immediately at design-time how your styled forms and controls will look when running.

Use Delphi's award-winning VCL framework for Windows and the FireMonkey (FMX) visual framework for cross-platform responsive UIs. Grab a Hex-Editor of your choice and look into it. Design Beautiful Desktop and Mobile App UIs with Delphi. This should do the job for experimenting. It requires only the RTL and has 2 empty units: MyUnit and Foo.OtherUnit. For analyzing a DCP, i created a new Package, called TestPackage.bpl. So let’s get started with our dirty work. I know that things might have changed from XE to XE8, but i hope this article is still helpfull to get anybody outside of XE started. Some searching didn’t reveal much (besides the same questions as i had). However, to do so, i had to work with DCPs, too. During the last past weeks, i wrote a Project-Analyzationtool, which is able to completely unwire all Unit-Dependencies and fix searchpathes. This includes name of BPL to link with, required DCPs and contained Units.
#Delphi xe findinfiles how to
During this Article, I’ll show how to read some very basic information from Delphi’s DCP-Files.
