DelphiFeeds.com

  • Dashboard
  • Popular Stories
  • Trending Stories
  • Feeds
  • Login
Trending now

Using Apilayer REST APIs from Delphi

Few remember the ancestry of programming languages

Trial – TMS WEB Core

Ultimate Way To Represent Networks In Your Delphi GUI App Using NetworkX Python Library

Video Tutorial: Develop Powerful Fluent User Interfaces For Windows 10 With Delphi

Learn How To Build Powerful Web Applications In Delphi With IntraWeb And TMS WEB Core

On my research list: Delphi “Package Cache” subtree

Astral Heroes Is A Beautiful Multiplayer Collectible Card Game Built In Delphi

Delphi Offers Massive Productivity Boost Over WPF And Electron

7 Tips For Learning To Build Powerful Windows GUI Apps Using Python And Delphi

Create Enterprise-Grade Grid Based Desktop Applications 10x Faster With X-Files Components

Quickly Learn How To Fetch A Table Using FireDAC In This IFDPhysCommand Delphi Sample

Tutorial: Introduction To C++ Parallel Compilation With TwineCompile

Easily Integrate Exception Handling Into Your Python GUI Apps Through Delphi

Delphi debugging tip: keep an eye on a object field of an object that will ...

Delphi Tip of the Day – Who’s up First?

1
Michael Riley Michael Riley 1 year ago in tip-of-the-day 0
I'm working on updating my old flagship product and I ran into an issue where a file kept getting deleted on startup. I could not for the life of me figure out where this was happening. I wound up adding vcl.Dialogs to all of the units and then adding code to the Initialization section of each unit hoping I could find out where the damned delete code was.
initialization
begin
ShowMessage('Inside [Unit Name Here]');
end;
Adding this code to each and every unit was a pain in the butt. And it still didn't help me track down where the file was getting deleted. There had to be an easier way to figure out the order in which each unit was being created.

I turned to the SO community asking for an easy way to generate a list of forms/units in the order they are created. I received the simplest and most elegant solution from Uwe Rabbe. He recommended looking at the C=ICODE segments of the map file.

My first two questions were, "What's a map file? And how do you create one?"

Information on what a *.map file is can be found here.
http://docwiki.embarcadero.com/RADStudio/Rio/en/API_%28%2A.map%29

To create a .map file from inside the IDE click Project > Options > Delphi Compiler > Linking

Set Map file := Detailed


Click Save

Then build your project and you will have a *.map file.

The reason I was having such a hard time tracking down where the file deletion was happening was because it took place within a "dll" file.



Line 47 of the map file shows the first unit of my project is Zglobals (yes the dreaded global unit). Lines 58-60 show the next three units from my project.

Line 59 StdDlls is a precompiled dll unit that I am unable to modify the source code for because it uses "Quick Reports". I do not have Quick Reports installed on my new dev computer. Therefore I cannot actually modify the source code for this unit.

It turns out that the file delete was happening inside the dll.

I just thought that Uwe Rabbe's solution to creating an ordered list of form/units was so simple and elegant I needed to share it with you in case you ever need a quick and easy way to see the order in which each Delphi unit gets created inside one of your projects.

Cheers!
Semper Fi,
Gunny Mike

Trending Stories

  • Using Apilayer REST APIs from Delphi

  • Few remember the ancestry of programming languages

  • Trial – TMS WEB Core

  • Ultimate Way To Represent Networks In Your Delphi GUI App...

  • Video Tutorial: Develop Powerful Fluent User Interfaces For Windows 10...

Embarcadero GetIt

  • Trial - TMS WEB Core

    Framework for creating modern web applications.

  • Brook Framework

    Microframework which helps to develop web Pascal applications.

  • Trial - TMS Scripter

    Add the ultimate flexibility and power into your apps with native Pascal or Basic scripting and […]

  • Trial - TMS VCL Chart

    DB-aware and non DB-aware feature-rich charting components for business, statistical, financial […]

  • Trial - TMS VCL Cloud Pack

    TMS VCL Cloud Pack is a Delphi and C++Builder component library to seamlessly use all major cloud […]

  • Learn Delphi Programming
  • Learn C++
  • Embarcadero Blogs
  • BeginEnd.net
  • Python GUI
  • Firebird News
  • Torry’s Delphi Pages
Copyright DelphiFeeds.com 2021. All Rights Reserved
Embarcadero
Login Register

Login

Lost Password

Register

Lost Password