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’ Category

FreePascal downloads I used to get Web Service Toolkit to compile since the Delphi WSDL importer has braindead include support

Posted by jpluimers on 2020/09/11

The Delphi WSDL importer maintenance has been in dormant mode for a long while, which means it still barfs on WSDL include directives.

In the day and age of REST and gRPC, I don’t think it will get any love soon.

Related bug entries are for instance RSP-18630: WSDL generate bad code and RSP-17321: “Import WSDL” generates invalid code without explanation of problem are examples of this, and I’m sure that QC had more if it were still alive; I could find these in the WayBack machine:

The problem manifests itself when the WSDL file includes one or more XSD files. The generated code will contain a section like this:

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Embarcadero types; however, they could also 
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //

Further below is a series of commented out types, all starting with a ! end ending in a column with the namespace of those types.

Searching for the first line gives numerous examples as far back as Delphi 7, for instance:

Based on those, I think the reason is that the WSDL importer fails on <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> which is quite common in the real world.

I did not want to pursue manually modifying the WSDL file, or manually generating the types as the WSDL and XSD files were prone to changes and manual steps would make the re-import process more tedious. If you do want to do that, these link might help:

This is what I used to get this to compile and run [WayBack] Web Service Toolkit – Free Pascal wiki:

Build steps

FPC installation

  1. Run the 32-bit installer
  2. Keep all options except on the second install screen, disable Associate .inc files with FreePascal IDE
  3. Add C:\FPC\3.0.4\bin\i386-win32 to the user path

Building

  1. Recursively unzip wst-0.7u.zip
  2. Open a command prompt in the wst-0.7u directory
  3. Verify there is a ws_helper subdirectory

When compiling in Delphi, then you definitely need the FreePascal RTL sources for the PasTree unit; see [WayBack] fcl-passrc – Free Pascal wiki.

Related:

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 1 Comment »

Keep Your Project Files Clean With Project Magician – The Art of Delphi Programming

Posted by jpluimers on 2020/09/10

Reminder to self to install this to more than just the main dev VM as it combines DProjNormalizer and DProjSplitter, then adds a few more features: [WayBackKeep Your Project Files Clean With Project Magician – The Art of Delphi Programming

Example of the wizard that shows the additional features

[WayBack] Download

Via [WayBackKeep Your Project Files Clean With Project Magician – Uwe Raabe – Google+

–jeroen

 

 

Posted in Delphi, Development, Software Development | Leave a Comment »

Delphi – tools to generate class diagrams/hierarchy from source code

Posted by jpluimers on 2020/09/09

I know ModelMaker Tools could do this: [WayBack] Quick Question … are there any good tools available to generate class diagrams / hierarchy from existing code? Or doesn’t anyone do that anymore ? – Stefaan Lesage – Google+

But I didn’t know the other tools from the thread had options as well:

–jeroen

Posted in Delphi, Development, Diagram, PlantUML, Software Development, UML | 1 Comment »

Fl Ko: Getting the pixel position of the current editor cursor position for an OTA wizard

Posted by jpluimers on 2020/09/08

Since WayBack cannot save G+ photos, here is one from [WayBack] So, now I’m in front of a problem similar to a former one: I need to get the pixel position of the current editor cursor position for my OTA wizard. I’… – Fl Ko – Google+:

Related:

–jeroen

Posted in C++, C++ Builder, Delphi, Development, Software Development | Leave a Comment »

Mike Versteeg tried getting Hi-DPI to work in Delphi 10.2

Posted by jpluimers on 2020/09/03

Wondering how far Mike Versteeg has gotten in the mean time with the newer versions of Delphi that have come up: [WayBack] I’m having a go at multi monitor high DPI support for my styled 64 bit VCL app, which is still not supported in 10.2. Using Scaled and ScaleBy I can com… – Mike Versteeg – Google+

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

Delphi consensus: interface implementing classes expose methods at private or protected level.

Posted by jpluimers on 2020/09/02

Interesting consensus at which is very similar to my experience: [WayBack] I’ve inherited a project and the developer uses lots of interfaces (All good here!). Then when they develop the interfaced classes, the methods from th… – John Kouraklis – Google+

Some go even further and even declare the classes in implementation sections, but for me that gives too much RTTI hassle:

Private types (types in the implementation section of units) do not get qualified names.

via: Delphi: TRttiContext.GetType versus TRttiContext.GetTypes is not about singular versus plural…

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

What’s the piece of Delphi knowledge you find yourself looking up over and over again…

Posted by jpluimers on 2020/08/31

From an interesting thread at [WayBack] What’s the piece of Delphi knowledge you find yourself looking up over and over again? For me format strings is probably the thing that most stubbornly… – Lachlan Gemmell – Google+

On the generics side, I have wrote a few bits in my blog before, often pointing to information by others (many by Stefan Glienke as his skills on this topic are beyond excellent):

And on records:

There are some very good books on Delphi though that dig deeper than the documentation:

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | 4 Comments »

“Fatal: F1027 Unit not found: ‘System.pas’ or binary equivalents (.dcu)”

Posted by jpluimers on 2020/08/25

If you ever get a “Fatal: F1027 Unit not found: ‘System.pas’ or binary equivalents (.dcu)” – Google Search, then it is likely because you:

  1. build from a script
  2. build use a user that has never ran the Delphi IDE

This is common for unattended builds (like build-automation).

For each run, the Delphi IDE will save an EnvOptions.dproj with global settings.

Since build scripts should not rely on global settings, you need to ensure those are in your project settings.

Some background reading on this:

–jeroen

Posted in Delphi, Development, Software Development | Leave a Comment »

Spring4D – Shared, Weak references

Posted by jpluimers on 2020/08/25

In addition to Shared/IShared, there is also Weak/IWeakReference in Spring.pas; these blog post explain more about them:

Related: If you were using Managed / IManaged in Spring4D, be aware they got renamed to Shared / IShared.

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, Software Development | Leave a Comment »

Delphi unit aliases: multiple ones can point to the same unit

Posted by jpluimers on 2020/08/20

A while ago, I had to figure out how to get some GExperts stuff cross-compile to older Delphi versions, because of UITypes usage that is not available in Delphi XE and lower (but much of what it contains is in the Types unit).

So I went down memory lane, as I remember in Delphi 2, the Delphi 1 WinTypes and WinProcs units were merged into the Windows unit.

A quick search revealed the stackoverflow entry mentioned here:

for the Delphi 1 -> Delphi 2 migrations, these aliases were used where multiple units pointed to the same one:

WinTypes=Windows;WinProcs=Windows;DbiProcs=BDE;DbiTypes=BDE;DbiErrs=BDE

See [WayBack] delphi – wintypes.dcu not found and code completion stops working – Stack Overflow

A longer search found this in my own archives:

File D2-CS-2.0\DEMOS\DOC\AUTOPROJ\AUTOPROJ.DOF

Has this line:

UnitAliases=WinTypes=Windows;WinProcs=Windows

Source: [WayBack] GX_GenericUtils.pas fails to build in Delphi 2007 because it uses unit UITypes · Issue #22 · jpluimers/GExperts · GitHub

(Ab)using unit aliases to fail on VCL

You can use unit aliases so your applications cannot use the VCL any more.

The trick is to alias Forms or VCL.Forms into something that does not exists, like Forms=__no_VCL_Forms__. The reason this works is that any VCL application uses the Forms unit because of the Forms.Application variable.

Reference:

–jeroen

Posted in Conference Topics, Conferences, Delphi, Development, Event, GExperts, Software Development | Leave a Comment »