Archive for the ‘Delphi’ Category
Posted by jpluimers on 2020/03/18
Still on my reading list because it is relevant to many programming environments: [WayBack] The Delphi Geek: Data-driven Multithreading.
Related:
–jeroen
Posted in Delphi, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2020/03/17
For my link archive if I want to make Explorer (for Linux caja) or console shortcuts to source or target directories: [WayBack] Fast-Forward »: My Lazarus External Tools with these XML files from [WayBack] Lazarus External Tools · GitHub:
And the Delphi equivalent from 2004: [WayBack] Fast-Forward »: My Delphi Tools, which addes “Open Source in Notepad2” and “Start Resource Explorer”.
via: [WayBack] Ondrej Kelle – Google+
–jeroen
Read the rest of this entry »
Posted in Delphi, Development, Lazarus, Software Development | Leave a Comment »
Posted by jpluimers on 2020/03/17
A few notes from my response to [WayBack] [Fatal error] F2084 Internal error : AV101E53EB-R0000000C-0 I’m getting this when trying to do some code completion. Any idea ? – Stéphane Wierzbicki – Google+:
This compiler related error usually made it go away for me either when it occurs during project compilation or when using code completion: Close the IDE. Delete your DCU files. Then restart the IDE.
Starting fresh gives a high chance if fixing this unless it is indeed a compiler related error in which case it returns. For that you need to trim down your code to see under which circumstances.
Reasoning (please shoot at it when things are wrong/missing):
Both the IDE code completion and the project compilation use the compiler. The DCU cache is shared between these compiler instances. The DCU cache depends on internal memory structures. Various pointer related errors (both from the IDE, compiler and 3rd party extensions) can damage this cache.
Especially weak IDE uses of the compiler are the find symbol and rename symbol functionalities. I’ve stopped using those about a decade ago.
Sometimes the F2084 (which I often mistype as F2048) is indeed an error in the compiler. Over the years, some of them have been fixed too. See my earlier articles on F2084.
–jeroen
Posted in Conference Topics, Conferences, Delphi, Development, Event, F2084, Software Development | Leave a Comment »
Posted by jpluimers on 2020/03/11
Bad surprise of the day: SysUtils.TEncoding in XE2+ defaults to ANSI, while in XE it defaulted to UTF-8 .Among other things this means that TStringList… – Eric Grange – Google+
Source: Bad surprise of the day: SysUtils.TEncoding in XE2+ defaults to ANSI, while i…
Delphi

+Stefan Glienke Indeed, you’re right. The issue must be deeper somewhere. Don’t have time to investigate too much, I’m bypassing the RTL now (also have to work around the limitation that for utf-8 the TEncoding.GetString method returns an empty string if one character in the buffer isn’t utf-8)

I wouldn’t trust the RTL at all with loading non-ascii text, we’ve had it hang on invalid UTF-8 codes more than once.
–jeroen
Posted in Ansi, Delphi, Development, Encoding, Software Development, UTF-8, UTF8 | Leave a Comment »
Posted by jpluimers on 2020/03/03
Too many people forget this (including myself) every now and then) so here is a reminder to use the [WayBack] SetString method when assigning strings from memory regions having characters but no null terminator:
Anyway, assuming that you use a Unicode Delphi you want to use SetString in its place:
SetString(password, PWideChar(Credential.CredentialBlob), Credential.CredentialBlobSize div 2);
It was by David Heffernan commenting on [WayBack] I have this code sample on StackOverflow using a function WideCharToWideString… I can’t seem to find anything on this function… – Nils Guillermin – Google+.
Note that like the above Delphi 2009 link (where it is a WideChar function to Unicode string conversion function), it was also available in Delphi 2007 and earlier as [WayBack] SetString.
–jeroen
Posted in Delphi, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2020/02/26
As this is still an issue with current Delphi versions: every now and then it looses which designers are needed for a frame:
[WayBack] What is the easiest way of getting Delphi to accept a newly added file as a frame and to treat it as such? – Stack Overflow (by Brian Frost)
<DCCReference Include="x\y\z\myFrame.pas">
<Form>frameMy</Form>
<FormType>dfm</FormType>
<DesignClass>TFrame</DesignClass>
</DCCReference>
Then check your .dfm file to see if it starts with the correct inherited or object as per Delphi – TInterfacedDataModule revisted – use ‘inherited’ in your .dfm files when your datamodules look like forms in the designer.
Oh and at design time, be very careful embedding frames. Better not to do it at all and for certain: do not embed frames in a nested way: [WayBack] Frames in 10.2.2 Hi Has anyone else had issues with frames under 10.2.2? The project seems to have lost its links to the frames? If I went to the Too… – Vince Bartlett – Google+
–jeroen
Posted in Delphi, Development, Software Development | 1 Comment »
Posted by jpluimers on 2020/02/26
This post is a reminder to myself that not all mappings from XSD to programming languages are possible.
There are many impossible cases, so this is just a general reminder.
A Delphi specific case for instance is the mapping of enumerations: one reason is that XSD enumerations are case sensitive, but the Delphi language is not: [WayBack] Using XML Enumerations with Delphi XML Data Binding Wizard – Stack Overflow.
More generic examples from my answer to the above question:
- In XSD you can derive from an existing type in two ways: extending it and limiting it. Object Oriented languages only allow you extend when deriving.
- Delphi is not alone in these kinds of limitations. Generating wrappers from XSD schema’s is the field of specialized tools, even in the Java or .NET world.
I’ve seen horrible things with wildcards that are sort of mappable to Java, but not to C#. This could likely go on for much longer…
–jeroen
Posted in C#, Delphi, Development, Java, Java Platform, Software Development, XML, XML/XSD, XSD | 2 Comments »
Posted by jpluimers on 2020/02/25
I missed this one, so I was glad I archived it because I was curious for Daan van der Werf – Delphi op de werkvloer “Groothandel & Magazijn”.
So here it is: [WayBack] Delphi Conference 2018 – Barnsten.com, with fixed and archived links where possible.
Presentations and code from the Delphi Conference 2018
…
- 09:30-10:30 – Keynote: Marco Cantú – Product Manager Delphi – “Delphi 10 for Windows 10 and beyond”
- 10:30-11:30 – Brian Long – Creative Delphi Debugging Techniques
- 11:50:12-40 – Brian Long – How to Access the Android API
- 11:50:12-40 – Bruno Fierens – A RADically new way to develop modern web applications
- 13:30-14:20 – Roald van Doorn – Continuous delivery with existing VCL Applications
- 13:30-14:20 – Daan van der Werf – Delphi op de werkvloer “Groothandel & Magazijn”
- 14:30-15:20 – Danny Wind – Micro Services and Progressive Web Apps (PWA) Delphi
- 14:30-15:20 – Bob Swart – Delphi en FireDAC Enterprise Connectors
- 15:40-16:30 – André Mussche – De opkomst van spraakherkenning
- 15:40-16:30 – Marco Cantù – RAD Server In Depth
–jeroen
Posted in Conferences, Delphi, Development, Event, Software Development | 2 Comments »
Posted by jpluimers on 2020/02/25
Reminder so self: [WayBack] sglienke / Spring4D / source / Source / Reactive / Spring.Reactive.pas — Bitbucket fragments:
type
TInterlocked = SyncObjs.TInterlocked;
TInterlockedHelper = class helper for TInterlocked // TODO: move to Spring.pas
class function CompareExchange<T: IInterface>(var Target: T; const Value, Comparand: T): T; overload; static;
class function Exchange<T: IInterface>(var Target: T; const Value: T): T; overload; static;
end;
{$REGION 'TInterlockedHelper'}
class function TInterlockedHelper.CompareExchange<T>(var Target: T;
const Value, Comparand: T): T;
begin
Result := Default(T);
PPointer(@Result)^ := CompareExchange(PPointer(@Target)^, PPointer(@Value)^, PPointer(@Comparand)^);
if PPointer(@Result)^ = PPointer(@Comparand)^ then
begin
if Assigned(Value) then
Value._AddRef;
end
else
if Assigned(Result) then
Result._AddRef;
end;
class function TInterlockedHelper.Exchange<T>(var Target: T;
const Value: T): T;
begin
Result := Default(T);
PPointer(@Result)^ := Exchange(PPointer(@Target)^, PPointer(@Value)^);
if Assigned(Value) then
Value._AddRef;
end;
{$ENDREGION}a
–jeroen
Posted in Delphi, Development, Software Development | Leave a Comment »