The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,780 other followers

Archive for the ‘Delphi 2007’ Category

Delphi Corner Weblog: New: Velthuis.AutoConsole unit – helps against the “optimised” Embarcadero FastMM fork.

Posted by jpluimers on 2017/05/17

Brilliant:

if it is a console program and it was started any other way (from the Windows Explorer, from the Delphi IDE with or without debugger, from another non-console program), then, before the console window can close, it will display:

Press any key...

Source: Delphi Corner Weblog: New: Velthuis.AutoConsole unit [WayBack]

via:

–jeroen

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, FastMM, Software Development | Leave a Comment »

Delphi multithreading – AcquireExceptionObject/ReleaseExceptionObject to pass exception from one thread to another thread – via G+ and Stack Overflow

Posted by jpluimers on 2017/02/07

A long time ago, Thomas Mueller (dummzeuch) – Google+ reminded [WayBack] me of this which I required a short while ago:

You can use AcquireExceptionObject():

AcquireExceptionObject returns a pointer to the current exception object and prevents the exception object from being deallocated when the current exception handler exits.

Then you can send the pointer to another thread and if you raise it there it will be freed for you, otherwise you must call ReleaseExceptionObject() to free it.

After the answer by Remy Lebeau [WayBack] and Remko [WayBack] is a comment [WayBack] by mghie [WayBack] that mentions AsyncCalls.pas that now is available on GitHub [WayBack].

If you have a very old (version <= 5) Delphi or just want to look at how AcquireExceptionObject [WayBack] looks like just look at a similar implementation there [WayBack]. Note that instead of the ReleaseExceptionObject [WayBack] call, AsyncCalls re-raises the exception [WayBack].

–jeroen

 

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2007, Delphi 2009, Delphi 2010, Delphi 5, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »

Delphi compiler: the –depends switch / DCC_OutputDependencies property outputs a .d file listing all .dcu and .dcp files – via Stack Overflow/G+

Posted by jpluimers on 2017/02/01

Every now and then you want to know what units your project is made of. Not just the units require to build your project, but actually the ones ending up in the executable (i.e. not removed by the compiler or linker).

I had long forgotten that Chris Hesik  [WayBack] wrote in debugging – How can I find all the units in my Delphi app? – Stack Overflow  [WayBack]:

you can have the Delphi compiler show you a list of used .dcus by passing –depends when you compile a project. It will output a .d file with a list of the .dcus (and .dcps) that were required.

This reminded me of that: The –depends option is supposed to work with the Delphi compiler, and it outputs a .d file. Does it still work in Berlin, and where is the file supposed to be output to? – David Nottage – Google+  [WayBack]

In the mean time, I wrote a batch file that parses the .MAP file to see which units actually made it into your .EXE  [WayBack] which works only for Widows executables (as I hardly do cross-platform Delphi development).

Uwe Schuster [WayBack] reported the IDE won’t pass on the –depends switch in Delphi XE and up (version 15.0.3953.35171) [WayBack] which means you need to pass this from the command-line.

Ondrej Kelle (G+/SO) pointed out that:

msbuild hello.dproj /property:DCC_OutputDependencies=true

  • It does work from the IDE if you check “use MSBuild externally”

The msbuild property setting is available in at least Delphi/C++Builder versions 2007 and 2010..Berlin as it is in CodeGear.Cpp.Targets and CodeGear.Delphi.Targets/RTL.Build.targets for BDS versions 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 and 18. It might be available in versions 2005/2006/2009 as well but I don’t have these lying around any more.

–jeroen

Read the rest of this entry »

Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, QC, Software Development | Leave a Comment »

Delphi “F2039 Could not create output file” on drc files

Posted by jpluimers on 2017/01/19

I had this error when building my Delphi app and needing detailed MAP files.

Somehow, then Delphi also tries to generate .drc files and fails.

Performing the “F2039 Could not create output file” drc – Google Search didn’t reveal much.

So I fired up Process Monitor and looked for file access patterns (see dump below), that all were OK.

Then I opened Windows Explorer and saw freshly generated .DRC files marked as some type of VLC Player file. I’ve had loads of trouble with VLC in the past, but I inherited this PC so I didn’t notice VLC Player was installed by the previous developer.

Lesson learned: when starting a gig, always request a fresh PC

So I uninstalled VLC Player and now everything works fine.

Oh btw: .DRC files are Delphi Resource String files.

–jeroen

Read the rest of this entry »

Posted in Delphi, Delphi 2007, Development, Software Development | 4 Comments »

Batch file to get a (non-sorted non-unique) list of units from a Delphi compiled map file

Posted by jpluimers on 2017/01/10

A few weeks ago in When you get “TfsScript.Execute” throwing a “Unregistered version of FastScript.” I wrote about “a process that explains any modules in the MAP file not resulting in DCU files”.

The below batch file aids in that process.

It takes a MAP file from your Delphi compiled executable that has debug information in text format which means you need to set your project linker options to generate detailed MAP files.

The Map Debug File (*.map) – RAD Studio documentation hasn’t much information but points to Detailed-Segments Map File – RAD Studio which has a bit more. Neither contain information on Delphi units as they focus too much on the C++ side of things. Then there is a tiny bit information in Understanding Delphi MAP File – Stack Overflow.

So I did some spelunking and came up with this batch-file which will likely work back until about the Delphi 7 era:

Read the rest of this entry »

Posted in Delphi, Delphi 10 Seattle, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | 1 Comment »

 
%d bloggers like this: