Archive for the ‘Delphi’ Category
Posted by jpluimers on 2013/08/09
Just found out this the hard way, glad I found it soon which prevented me from doing like Ondrej Kelle – Google+ – Wasted a few hours with this….:
Debugging 64 bit Delphi applications with Delphi XE2 on Windows 8 does not work
Problem: Debugging a 64 bit Delphi application using Delphi XE2 with Windows 8 results in the error Disconnected session.
Solution: Windows 8 is not a supported platform for versions of Delphi prior to Delphi XE3. To get debugger support for 64 bit applications on Windows 8, you must get Delphi XE3. If you are upgrade sensitive, Embarcadero recommends you get Support and Maintenance along with your next purchase. Support and Maintenance guarantees you all updates for 1 year and gets you 3 support incidents in addition.
The proposed solution is to upgrade to at lease Delphi XE3, but this project is not ready to upgrade just yet.
Anybody with a real workaround (apart from downgrading to Windows 7)?
–jeroen
via Error: Disconnected session.
Posted in Delphi, Delphi XE2, Development, Software Development | 4 Comments »
Posted by jpluimers on 2013/08/08
Peter Leslie Morris asked if Delphi already incorporates the `yield` keyword that C# had introduced in C# 2.
Delphi doesn’t, but for the people interested what it does in C#:
Basically `yield` is syntactic sugar to make it a lot easier to write methods that return enumerators of some sort.
It delays (hence the yield keyword) execution until the enumerator as actually being used.
It is one of the hardest C# things to master (it is the most complicated transformation in the compiler, followed by anonymous methods – well maybe with the exception of async/await), but it can be very useful.
VB.NET doesn’t have it either (thanks André!) has it too, but and also has iterator blocks.
Some start posts on yield:
–jeroen
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Delphi, Development, Software Development | 10 Comments »
Posted by jpluimers on 2013/08/06
StackOverflow user opcOde wrote something interesting:
Writing device drivers in delphi is hard to impossible.
Here is an attempt to write drivers in delphi.
It is funny to see the link pointing to the DelphiBasics site: Advanced Delphi Driver Development Kit – DelphiBasics.
On my list of things to remember: might come in very useful one day (:
Note that opcOde also has an interesting blog: opc0de | just another enthusiastic coder.
–jeroen
via delphi – Winrollback/DeepFreeze How these softwares work? – Stack Overflow.
Posted in Delphi, Delphi 2010, Delphi 7, Development, Software Development | 9 Comments »
Posted by jpluimers on 2013/08/06
I was called by a client that didn’t want to do maintenance on an old Delphi application, but wanted to get dir of an I/O Error 131:
I/O Error 131: ERROR_NEGATIVE_SEEK
MessageText: An attempt was made to move the file pointer before the beginning of the file.
Tough luck: psychic powers told me someone is using an unsigned 32-bit integer to access a file using traditional style Assign/Reset/Seek/Read/Close patterns that Delphi kept as intrinsic routines for Turbo Pascal backward compatibility, and that file has grown over 2 gigabyte in size.
I quickly found an import file had grown over the 2 gigabyte, so this was indeed the case.
The original developers didn’t do the file access using the 64-bit Seek/Position of the TStream descendant TFileStream.
Too bad, as now someone has to dig through the mothballs to find the sources (if they survived 3 different version control system switches), create a working development environment, and fix the bug.
Another instance where technical debt in IT raises its ugly head and the compound interest is really expensive.
–jeroen
via: erikmartin.com – IO Errors in Delphi.
Posted in Conference Topics, Conferences, Delphi, Delphi 5, Development, Event, Software Development, Technical Debt | 14 Comments »
Posted by jpluimers on 2013/07/30
A while ago, I needed routines to work with absolute and relative paths on Windows.
These links were very useful:
- The Delphi TPath.IsDriveRooted function (I think it was introduced in Delphi 2010) serves as a IsPathAbsolute function
- Conversion between absolute and relative paths in Delphi – Stack Overflow showing how to use the Windows API functions PathRelativePathTo and PathCanonicalize functions declared in the ShLwApi unit to create AbsToRel and RelToAbs functions.
Thanks Andreas Rejbrand and David Heffernan for the last two!
–jeroen
via: Conversion between absolute and relative paths in Delphi – Stack Overflow.
Posted in Delphi, Delphi 2010, Delphi XE, Delphi XE2, Delphi XE3, Development, Software Development | 4 Comments »
Posted by jpluimers on 2013/07/26
During code reviews, I often see people do things like this:
if (not DirectoryExists(Path)) then
ForceDirectories(Path))
or this:
if (not TDirectory.Exists(Path)) then
TDirectory.CreateDirectory((Path))
Half a year ago, I wrote about .NET/C#: do not do “if (!Directory.Exists(path)) Directory.CreateDirectory(path))”. Read the rest of this entry »
Posted in Delphi, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Software Development | 16 Comments »
Posted by jpluimers on 2013/07/25
Replay video’s can be viewed through streaming.embarcadero.com (where you can also find the other series, downloads, etc).
The SummerSchool 2013 replay videos are at streaming.embarcadero.com/summerschool2013.
The Q&A from today’s session on “Accessing local storage” demonstrating iOS specifics in Delphi XE4: Read the rest of this entry »
Posted in Delphi, Delphi XE4, Development, Software Development | Tagged: Delphi, embarcadero, iOS, OS, software, technology | Leave a Comment »
Posted by jpluimers on 2013/07/25
Posted in .NET, .NET 2.0, .NET 3.0, .NET 3.5, .NET 4.0, .NET 4.5, C#, C# 2.0, C# 3.0, C# 4.0, C# 5.0, Delphi, Delphi XE2, Delphi XE3, Development, Software Development | 4 Comments »
Posted by jpluimers on 2013/07/18
I bumped into the below answer that I gave a while (what is 4 years in a developer’s life ) on StackOverflow.
It is about Delphi Design Patterns. Sepcifically the Factory Pattern, and explains how virtual constructors implement it.
They are one of the 3 corner stones on which the component based Delphi form designer and object inspector are built:
- Virtual constructors
- Properties (events are just a special form of property)
- Run-Time Type Information.
So here it goes: Read the rest of this entry »
Posted in Delphi, Delphi 1, Delphi 2, Delphi 2005, Delphi 2006, Delphi 2007, Delphi 2009, Delphi 2010, Delphi 3, Delphi 4, Delphi 5, Delphi 6, Delphi 7, Delphi 8, Delphi XE, Delphi XE2, Delphi XE3, Delphi XE4, Development, Software Development | 6 Comments »