Archive for the ‘Delphi XE8’ Category
Posted by jpluimers on 2017/04/27
Nice find:
Stefan Glienke+4
Look into the initialization block of FMX.Dialogs. The call to ActivateClassGroup(TFmxObject); turns off all the TRegGroups that don’t contain at least one type that inherits from TFmxObject which also happens to be the group that you register your form class to. GetClass then ignores such groups.
I don’t have the slightest idea what the intention behind all that code is but it certainly is one of the reasons why you cannot mix FMX and VCL officially.
In response to:
I have an VCL application. I need to register some form classes at run time. This is done in the form’s unit implementation section :
Initialization
If GetClass(‘TfmConnectiondialog’) = Nil Then
Classes.RegisterClass(TfmConnectiondialog);
Suddenly my class wasn’t registered anymore. GetClass(‘TfmConnectiondialog’) was always nil and Classes.RegisterClass had no effects.
After some long search, I’ve found that I’ve inadvertently added an FMX.Forms in one of my unit. This was the culprit. Replacing FMX.Forms with VCL.Forms solved my problem.
Behaviour is really strange, why Classes.RegisterClass didn’t throw any exception ? Is this a “Bug” or is this “as expected” ?
–jeroen
Source: Hello, I have an VCL application. I need to register some form classes at ru… [WayBack]
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi XE7, Delphi XE8, Development, Software Development | 1 Comment »
Posted by jpluimers on 2017/04/18
One of the reasons I favour using RTL based functionality over Delphi Intrinsic Routines like Length, Abs and others is that you cannot use compiler intrinsics in Generics. For instance Length is not compatible with TFunc<string, Integer> unless you declare it yourself like function StringLength(value: string): Integer; as otherwise you get en E2029 error (in this case the cryptic '(' expected but ';' found).
It’s one of the many areas where the Delphi compiler developers took a shortcut, but in this case I think the results are somewhat good.
Other reasons for using the RTL over compiler intrinsics have to do with scoping: the intrinsics are in the global scope which can clutter what you’re trying to work on.
So I much rather use the file and stream related functions when I’m actually working with a file or stream. For instance Assign for me has nothing to do with a file outside of a file context (it’s the reason AssignFile exists in the first place).
–jeroen
via: I cant use “Length” as a TFunc (tested in XE and XE6), but if…
Posted in Conference Topics, Conferences, Delphi, Delphi 10 Seattle, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Event, Software Development | 1 Comment »
Posted by jpluimers on 2017/02/28
[WayBack] New book by +Nick Hodges tech preview by +Stefan Glienke https://leanpub.com/dependencyinjectionindelphi – via Jeroen Wiert Pluimers – Google+:
This book covers Dependency Injection from A to Z. In it you’ll learn about Constructor Injection, Property Injection, and Method Injection. You’ll learn about the right and wrong way to use the Dependency Injection Container.
Source: Dependency Injection In Delphi by Nick Hodges [Leanpub PDF/iPad/Kindle]
This is the Chapter List:
- What is Dependency Injection
- Benefits of Dependency Injection
- Constructor Injection
- Property Injection
- Method Injection
- Using the Container
- A Simple Migration Example
- Advanced Uses of the Container
- Dependency Injection Anti-patterns
- A Full, Useful Example
- Final Thoughts
–jeroen
Source: New book by +Nick Hodges tech preview by +Stefan Glienke https://leanpub.com/…
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2017/02/23
the release of 1.2 is almost there! We are working hard to deliver it shortly after the next Delphi release which will happen … soonish, I think. ;)
The release/1.2 branch has been around for a while – please take a look if you haven’t already. It contains a lot of new features and bugfixes. I will tell you more about some of the amazing features next time which won’t take as long as it took since the last blog post – promise. :)
Apart from a very interesting take on DI resolvers, the above great info too!
Please take a look at spring4d/branch/release/1.2 as it has been very stable for quite some time.
Source: [WayBack]: Delphi sorcery: Generics, modules and typeinfo
–jeroen
via: [WayBack] Finally some blog article again ;) – Stefan Glienke – Google+
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2017/02/21
Does anyone have a run-time fix for CreateInOutError raising an EInOutError with Code=3 (correct) and Message=’Invalid file name – %s’ (incorrect becaus… – Jeroen Wiert Pluimers – Google+
[WayBack] Does anyone have a run-time fix for CreateInOutError raising an EInOutError w…:
Does anyone have a run-time fix for
CreateInOutError raising an
EInOutError with
Code=
3 (correct) and
Message=
'Invalid file name - %s' (incorrect because
System.SysUtils should have used
System.SysConst not
System.RTLConst and
System.RTLConst wrongly duplicates some resource strings in
System.SysConst) See [
WayBack]
http://qc.embarcadero.com/wc/qcmain.aspx?d=129530.
It would be so cool if a fix fills in the %s with the invalid file name.
–jeroen
Later: this seems to be reported in [RSP-20588] Exception message created for missing file has %s – Embarcadero Technologies
Posted in Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi XE7, Delphi XE8, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2017/02/15
Posted in .NET, C#, Delphi, Delphi 10 Seattle, Delphi 10.1 Berlin (BigBen), Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Delphi XE6, Delphi XE7, Delphi XE8, Development, Encoding, FreePascal, Pascal, Software Development | Leave a Comment »
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 [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 »
Posted by jpluimers on 2017/02/02
I had to add this to my DCC_Namespace in the rbTC1416.dproj file to make it build under Delphi XE8:
Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;
The occurrence of this DCC_Namespace setting corresponds to the “Unit scope names” of the “All configurations – All Platforms” target in the project options.
That got rid of this error mesage:
[dcc32 Fatal Error] ppChrt.pas(17): F2613 Unit 'Graphics' not found.
It was for a site that had very little ReportBuilder but a truckload of FastReports stuff, so I temporarily needed their ReportBuilder for XE2 to just load in Delphi XE8 at design time so I could migrate.
Apparently not all the ReportBuilder packages use the same namespace definitions. Even worse: they add various namespaces at various target levels in an inconsistent way, so it took me a bit more time than I originally hoped for sorting this out.
Below is what the original settings were: only the .\TeeChart\Win32\TeePro900 directory had TeeChart project files (the .\Source and .\TeeChart\Win32\TeeStd900 directories hadn’t) and all three had slightly different unit source files for TeeChart support.
Read the rest of this entry »
Posted in Delphi, Delphi XE8, Development, Software Development | Leave a Comment »
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 »
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 »