The Wiert Corner – irregular stream of stuff

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

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

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

    Join 1,862 other subscribers

Archive for the ‘Delphi XE3’ Category

Delphi postbuild events: interesting take by David Heffernan (via: Stack Overflow)

Posted by jpluimers on 2013/12/12

StackOverflow user David Heffernan – Stack Overflow has an interesting take on Delphi postbuild events:

At the moment my actiona read:

if exist PostBuild.bat call PostBuild.bat $(Platform) $(Config) $(OutputDir)

And then the PostBuild.bat script calls a Python script so that I can write my scripts in a real language.

I actually impose the build actions in a shared option set that I reference from all of my projects. That way I enforce consistency and predictability.

I know others use tools like FinalBuilder but building is so important that I feel it’s worth my effort in rolling my own tooling.
– David Heffernan Feb 14 at 20:24

–jeroen

via: Delphi XE3: Problems with complex pre-build events – Stack Overflow.

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Development, Software Development | Leave a Comment »

Funny Delphi code of the day: on literals

Posted by jpluimers on 2013/12/09

The fact that the [WayBack] 31-character limit on ClientDataSet field and index names is worse, but I just encountered this GetParamNameWODog function in a Delphi 3rd party library:


function GetParamNameWODog(const ParamName: _string): _string;
begin
if (ParamName <> '') and (ParamName[1] = '@') then
Result := Copy(ParamName, 2, 1000)
else
Result := ParamName;
end;

What’s wrong with using the Length function here?

Yes, SQL Parameter names will probably less than 1000 characters, but then the 1000 literal should be a constant with a meaningful name, and the '@' literal should be too. Read the rest of this entry »

Posted in Delphi, Delphi XE3, Development, QC, Software Development | Tagged: , , | 12 Comments »

Delphi .dproj files: FrameworkType and FormType (via: Embarcadero Discussion Forums)

Posted by jpluimers on 2013/11/28

One more of the “Missed Schedule” series, this time it was originally scheduled for October 1st, (2013 that is).

Delphi XE2 and up introduced the FrameworkType and FormType elements in the .dproj files to distinguish between VCL and different flavours of FireMonkey.

Actually, Delphi XE1 already had the value None for FrameworkType, so some cross-platform changes trickled into the Delphi builds early.

Though the IDE writes these values to the .dproj files, you [Wayback/Archive] cannot change their values from within the Delphi IDE, not even through the Open Tools API.

There is no documentation about the values in the .dproj files. the only places I could find were these about FrameworkType in combination with [Wayback/Archive] Actions:

that basically tell this:

FrameworkType

Defines whether an action is created for the VCL or FireMonkey (FMX) framework. The default of this parameter is VCL (for compatibility with legacy applications).

This parameter is used to avoid situations when VCL actions are used in FireMonkey applications and inversely; this can lead to a serious increase in an application’s size and to execution errors, for example, calling of Windows API under MacOS.

But it is incomplete, and there is no documentation about FormType. Read the rest of this entry »

Posted in Delphi, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Missed Schedule, SocialMedia, Software Development, WordPress | Leave a Comment »

Subtle things on naming conventions (:

Posted by jpluimers on 2013/11/26

Sometimes a naming convention has been in place for quite a while, then new functionality breaks it.

One of the naming conventions in the JVCL is that all Delphi design-time packages follow the naming pattern *Design##.bpl

Until a package with run-time design functionality came along named (for Delphi XE3) as JvRuntimeDesign170.bpl. The actual design-time package for that is JvRuntimeDesignDesign170.bpl (:

I guess some of the reporting tools bumped into the same thing when they added run-time design support as well.

–jeroen

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

Optimize your Delphi installed disk size

Posted by jpluimers on 2013/11/26

Another instalment in the WordPress Missed Schedule series (:

Each version, Delphi gets more features, and grows bigger.

Especially in testing environments (where you want to have a cut-down base machine you can clone from), it is wise to cut down on the installation size.

A few directories you might want to consider compressing for your Delphi installation:

  • C:\Users\All Users\{*}
    The directories with GUID names contain the installer cache. You can ditch the whole installer cache if you keep ISO images of all installations. I prefer just to compress these directories.
    Compressing usually saves 50% of the storage there, which can count for 5+ gigabyte of savings for the newest Delphi version.
  • C:\Users\Public\Documents\RAD Studio
    Contains (among others) the help files and SVN examples, and (for the most recent version) the Platforms SDKs.
    Saving is usually a couple of 100 megabytes for less recent Delphi versions until about 1 gigabyte for the most recent.
  • C:\Program Files (x86)\Embarcadero\RAD Studio\#.0\lib
    This contains all the precompiled files. Since they are readonly in nature, it pays of compressing them, usually saving 50% or more.
    Saves 5+ gigabytes for the most recent Delphi version.

–jeroen

Posted in Delphi, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Missed Schedule, SocialMedia, Software Development, WordPress | Leave a Comment »

When the Delphi XE5 commandline compiler fails with `error F1026: File not found: ‘False.dpr’`

Posted by jpluimers on 2013/11/20

If you an error like below when compiling Delphi XE5 .dproj files using msbuild … then note the documentation for Debug information (Delphi) – RAD Studio. has not been updated yet as it still lists the values {$D+} or {$D-} {$DEBUGINFO ON} or {$DEBUGINFO OFF}.

(_PasCoreCompile target) -> C:\Program Files (x86)\Embarcadero\RAD Studio\12.0\Bin\CodeGear.Delphi.Targets(187,5): error F1026: File not found: 'False.dpr'

With Delphi XE5, you can specify 3 additional values: {$D1}{$D2} and {$D0}, or {$DEBUGINFO 1}{$DEBUGINFO 2} or {$DEBUGINFO 0}

In the msbuild .dproj files , the values are stored as DCC_DebugInformation elements. Read the rest of this entry »

Posted in Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Missed Schedule, SocialMedia, Software Development, WordPress | 13 Comments »

Delphi – Direct3D and the wrong FPU state: Now() function returns a wrong value (via: StackOverflow)

Posted by jpluimers on 2013/10/31

The question datetime – Delphi Now() function returns a wrong value – Stack Overflow is similar to my article Delphi – Michael Justin had strange floating point results when his 8087 FPU Control Word got hosed.

Good that stackoverflow user Anton Zhuchkov found out the cause himself: his answer indicates the Precision Control (and rounding) part of the FPU state got hosed by wrongly initializing the Direct3D device.

I edited his answer with some extra links to documentation.

Finally I’ve found the solution. I needed to specify the D3DCREATE_FPU_PRESERVE flag when creating a D3D device by D3D.CreateDevice.

Otherwise, without that flag, all floating point operations are performed with single precision. As the TDateTime is a simple Double, and Now() functions is consist of simple addition of date value to time value, it all get messed up by DirectX “smart” override.

Problem solved. It was a tricky one indeed. :)

–jeroen

via: datetime – Delphi Now() function returns a wrong value – Stack Overflow.

Posted in 8087, Algorithms, Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Development, Floating point handling, Software Development | 2 Comments »

.NET/C#/VB.net: some links on ExpandoObject

Posted by jpluimers on 2013/10/10

Still a C# 4.0 / .NET 4 feature that I need to investigate more deeply: ExpandoObject, partially because I had very bad memories of Variant support in Delphi.

So here are a few links.

First of all: since VB.NET already does late binding with the Object keyword, you cannot use ExpandoObject with Strict On in VB.NET 10.0 and up:

Now the C# links:

–jeroen

Posted in .NET, .NET 4.0, .NET 4.5, C#, C# 4.0, C# 5.0, Delphi, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi XE, Delphi XE2, Delphi XE3, Development, Software Development | 5 Comments »

Delphi Mobile (NEXTGEN) compiler: the risk of a changed TSymbolName; unsupported data types means unsupported RTTI as well

Posted by jpluimers on 2013/09/05

The NEXTGEN family of Delphi compilers for the Mobile platforms changed quite a bit of things.

Most of it has been covered by various blogs posts. A non exhaustive list of ones I liked:

Those articles do not contain two things I had’t found about yet though that are important when you do RTTI using NEXTGEN in Delphi XE4: Read the rest of this entry »

Posted in Delphi, Delphi XE3, Delphi XE4, Development, Encoding, Software Development, Unicode, UTF-8 | 2 Comments »

XSD/XML Schemas: resolving `Namespace ” is not available to be referenced in this schema` (via: StackOverflow)

Posted by jpluimers on 2013/09/01

While working on my Delphi: First try on an XSD for .groupproj files, I bumped into an error `Namespace ” is not available to be referenced in this schema`.

I added a targetNamespace attribute to the GroupProj.xsd so the .grouproj files would use the right namespace.

That resulted into two funny errors:

  1. Namespace ” is not available to be referenced in this schema.
    Visual Studio (which I normally use for editing XSD) would only throw this error on these elements:
    <xsd:element ...>
    So it would not throw them on nodes using the empty namespace.
    That was really confusing!
  2. When validating .grouproj files using this GroupProj.xsd, I would get this error for all .groupproj files:
    System.Xml.Schema.XmlSchemaValidationException: Type ‘<type>’ is not declared. (in this case for ‘<type>’  ‘ProjectType’).
    That was odd too: the ‘ProjectType’ was indeed declared, and should be valid.

I could hardly find any information about the latter error, but the former gave a few useful hits.

Thanks User weston – Stack Overflow. for answering this: it made me smack to my head (like usual, a case of EBCAK). Read the rest of this entry »

Posted in Delphi, Delphi 2007, Delphi 2009, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Delphi XE5, Development, Software Development, XML/XSD, XSD | Tagged: , , | 2 Comments »