tag:blogger.com,1999:blog-69770692024-03-07T05:44:29.072+01:00Hallvard's BlogConfessions of a Delphi hacker - Delphi programming tips, hacks and stuff.Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.comBlogger145125tag:blogger.com,1999:blog-6977069.post-10069652553234344552021-10-20T14:24:00.001+02:002021-10-20T15:30:33.272+02:00Are you the Delphi developer we're looking for..? :)Despite the lack of new posts in this blog, we are very much alive and kicking. Many exciting things have been going on with our company (Infront ASA) - and now we're looking to expand our Delphi development team in Oslo.Click here to go to the position descriptionYou'll find general info about our company here: Infront CareersOur main product - the Infront Professional Terminal is describedHallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com4tag:blogger.com,1999:blog-6977069.post-14102335069917677632014-06-10T17:01:00.000+02:002014-06-11T10:20:06.445+02:00How to report an issue (aka a bug)So much time could be saved if everyone followed these simple steps when reporting issues:
1. What did you do? (the dreaded steps)
2. What happened? (screenshots, logs etc are useful here)
3. What did you expect to happen?
Steps are crucial to try and reproduce the problem.
Describing what actually happened and contrasting it with what you expected to happen is essential to decide what Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com3tag:blogger.com,1999:blog-6977069.post-18027064118425740542011-11-04T09:31:00.003+01:002011-11-04T15:34:06.709+01:00Why no blogging? Alive and kicking :-)As you may have noticed (or not :), this Blog has been silent since 2008. Several people have asked me recently why I'm not blogging anymore - here is a short explanation.I was blogging quite actively for a while, but other priorities in my life (family, work, new house, exercising etc) have taken over. There is only so much time.While I've been silent on the blog for a few years now, I'm still Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com12tag:blogger.com,1999:blog-6977069.post-81606795829416975142008-03-30T18:37:00.003+02:002010-08-22T18:43:39.865+02:00TDM#10: BorDebug – Return of the Giant "The Delphi linker has always had the option of including so-called Turbo Debugger (TD32) debug information (on the Linker page of the Project Options dialog). The internal IDE Debugger does not normally use this information (Delphi 4 and 5 uses it when debugging external DLLs and EXE files), but instead relies on internal compiler structures build during an interactive compile. External toolsHallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com5tag:blogger.com,1999:blog-6977069.post-37870896571793768462008-03-15T20:02:00.001+01:002008-03-15T20:13:46.991+01:00TDM#9: Exceptional Stack Tracing (HVEST)One of the key questions you should ask yourself as a serious Delphi developer is; what kind of exception handling and logging am I using. If you're not using any custom or third party solution for tracking down exceptional incidents that occur in your production systems or at your customer sites, you're missing out big time! A proper exception handling and logging system should at least log the Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com4tag:blogger.com,1999:blog-6977069.post-29066883890868395912008-03-11T23:04:00.001+01:002008-03-11T23:04:49.293+01:00TDM#8: DelayLoading Of DLLs "I don’t miss many features from Microsoft’s Visual C++ 6.0 when working in Delphi, but the new /DELAYLOAD option of the linker is one of them. This option lets you turn normal, implicit DLL import libraries into so-called delayload import libraries. This means that the DLL will not be loaded by the operating system (OS) during start-up of the EXE file, but rather on an as-needed basis when you Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com6tag:blogger.com,1999:blog-6977069.post-17922068768456640372008-03-06T22:16:00.001+01:002008-03-06T22:16:03.626+01:00TDM#7: Design Patterns; Singleton "In their book Design Patterns, Gamma et al (a.k.a. the gang of four) lay the foundation for a new way of approaching software design. [...] In this article we will first look at the language elements that are unique to Object Pascal when compared to C++ and how this makes many of the problems the design patterns try to solve, non-existent, or at least much easier to solve. Then we will look atHallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com2tag:blogger.com,1999:blog-6977069.post-51074939292415429742008-03-02T22:30:00.001+01:002008-03-02T22:30:52.799+01:00TDM#6: Knitting Your Own ThreadsOne of the key reasons that computers have conquered the world is that they have been following Moore's Law with faster, smaller and cheaper CPUs (and similar "laws" and improvements of memory, hard disks, graphics cards, etc) coming out every year. Until recently, all programs have just become faster and faster due to improved hardware. This has been dubbed "the free lunch" and has given sloppyHallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com0tag:blogger.com,1999:blog-6977069.post-40083712244350949192008-02-12T22:25:00.001+01:002008-02-12T22:25:18.900+01:00TDM#5: Slimming the Fat off Your AppsI think that the best TDM article title I've had is Slimming the Fat off Your Apps. It was published in November 1998 and we're still in the Delphi 4 era (but as always many people were still using the older versions, D2 and D3). The article intro said: "Hallvard Vassbotn wants to slim the fat off your software: tune in here if you want [your programs] to be leaner and fitter..." The core pointsHallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com5tag:blogger.com,1999:blog-6977069.post-78491585721858923942008-01-30T22:26:00.001+01:002008-01-30T22:26:51.466+01:00TDM#4: Delphi 4 Bugs and FixesDelphi 4, released in the summer of 1998, was one of the most notorious Delphi releases ever. The initial release contained a large number of serious bugs, and it later became clear that the release date had been pushed by management and/or marketing and not sanctioned by technical and R&D. While all of this is water under the bridge, one very visible bug, the so-called TListBox Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com5tag:blogger.com,1999:blog-6977069.post-65649557130520804162008-01-26T21:18:00.001+01:002008-01-30T16:21:33.105+01:00TDM#3: The Rise and Fall of TObject "Consider yourself an Delphi expert? Here is a test question for you: Can you name the 8 methods of TObject that are part of the process of constructing and destroying objects in Object Pascal" That was the introductionary question of my The Rise and Fall of TObject article published in The Delphi Magazine, July 1998. Now we're in the era of Delphi 3, with Delphi 4 just being released. The Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com5tag:blogger.com,1999:blog-6977069.post-149768566574398732008-01-24T22:00:00.001+01:002008-01-24T22:00:42.504+01:00TDM#2: Hooking HeapcheckInspired by the apparent popularity if my YAST article, a few months later, in July 1996, I published my second Delphi Magazine article - called Hooking HeapCheck. While the article is mainly irrelevant to 32-bit Delphis, it does show what is possible to achieve with a little hacking. The gist of the article is to expand a mostly useless, parameterless Delphi 1 memory manager callback-function, Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com0tag:blogger.com,1999:blog-6977069.post-89715168051817334332008-01-22T22:20:00.001+01:002008-01-23T22:29:55.075+01:00TDM#1: Yet Another Stack Tracer "Have you ever had any really hard-to-find bugs in your code? If not, you can skip this article, otherwise you’d better keep on reading!" The above quote was the enticing introduction to my first full-feature Delphi Magazine article with the ironic title Yet Another Stack Tracer (or YAST for short). It was published in the seventh TDM issue, March 1996. The contents page said: "YAST: Yet Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com2tag:blogger.com,1999:blog-6977069.post-77685167248341707072008-01-22T22:05:00.001+01:002008-01-22T22:05:06.608+01:00Republishing my old The Delphi Magazine articlesAs you probably know The Delphi Magazine is no longer in publication. As their web-site indicates the articles and source code repository will only be online for a short while longer, but it is still possible to order the excellent value-for-money 1GB USB stick with all magazine issues and code. TDM was generally accepted as the best source of technical articles about Delphi and development Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com4tag:blogger.com,1999:blog-6977069.post-14255522548746502452007-11-02T07:29:00.001+01:002007-11-02T07:29:38.768+01:00DN4DP: The Delphi Language Chapter We have finally come to an end in the long running series of of The Delphi Language Chapter teasers from Jon Shemitz’ .NET 2.0 for Delphi Programmers book. All the chapter excerpts that I have posted can be seen by clicking on the DN4DP blog label. As a service to our readers, I'm also including a full list of all the post links here. Classic Delphi and .NET book in the making Come get a Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com1tag:blogger.com,1999:blog-6977069.post-19079681999253809972007-11-01T07:56:00.001+01:002007-11-01T07:56:49.091+01:00DN4DP#30: Delphi vs C#This post continues the series of The Delphi Language Chapter teasers from Jon Shemitz’ .NET 2.0 for Delphi Programmers book. Last time we looked at .NET and Win32 constructors. This is the final post in this long running series and it covers the main differences between Delphi and C#. Note that I do not get any royalties from the book and I highly recommend that you get your own copy – forHallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com5tag:blogger.com,1999:blog-6977069.post-29370268761356542542007-10-31T07:56:00.001+01:002007-10-31T07:56:20.898+01:00DN4DP#29: .NET vs Win32: ConstructorsThis post continues the series of The Delphi Language Chapter teasers from Jon Shemitz’ .NET 2.0 for Delphi Programmers book. Last time we looked at class references. This posts covers .NET vs Win32 constructors. Note that I do not get any royalties from the book and I highly recommend that you get your own copy – for instance at Amazon. "Constructors While it is a good rule in Win32 to Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com0tag:blogger.com,1999:blog-6977069.post-69845614842810265962007-10-30T08:58:00.001+01:002007-10-30T08:58:45.332+01:00DN4DP#28: .NET vs Win32: Class referencesThis post continues the series of The Delphi Language Chapter teasers from Jon Shemitz’ .NET 2.0 for Delphi Programmers book. Last time we looked at differences in abstract class behavior. Here we look at class references. Note that I do not get any royalties from the book and I highly recommend that you get your own copy – for instance at Amazon. "Class references For the most partHallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com0tag:blogger.com,1999:blog-6977069.post-59708385647755329762007-10-28T14:32:00.001+01:002007-10-28T14:38:02.822+01:00DN4DP#27: .NET vs Win32: Abstract classesThis post continues the series of The Delphi Language Chapter teasers from Jon Shemitz’ .NET 2.0 for Delphi Programmers book. Last time we looked at initialization and finalization sections. This post covers some minor differences in abstract class behavior. Note that I do not get any royalties from the book and I highly recommend that you get your own copy – for instance at Amazon. "Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com0tag:blogger.com,1999:blog-6977069.post-26955719429311735232007-10-26T23:25:00.001+02:002007-10-28T09:30:18.214+01:00DN4DP#26: .NET vs Win32: Initialization and finalizationThis post continues the series of The Delphi Language Chapter teasers from Jon Shemitz’ .NET 2.0 for Delphi Programmers book. Last time we looked at the .NET and Win32 casting issues. Here we quickly covers some potential gotchas related to initialization and finalization sections. Note that I do not get any royalties from the book and I highly recommend that you get your own copy – for Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com0tag:blogger.com,1999:blog-6977069.post-34262808898219468412007-10-23T21:30:00.001+02:002007-10-23T21:39:36.197+02:00Sergey Antonov implements Yield for Delphi!The Russian Delphi programmer Sergey Antonov (or Антонов Сергей - aka. 0xffff) is a real hacker in the positive sense. He approached me with some intriguing assembly code that implements the equivalent of the C# yield statement! Yield makes it easier to implement enumerators (you know the simple classes or records with methods like GetCurrent and MoveNext that enables the for-in Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com7tag:blogger.com,1999:blog-6977069.post-89193417294098314502007-10-20T22:12:00.001+02:002007-10-28T09:34:50.122+01:00DN4DP#25: .NET vs Win32: CastingThis post continues the series of The Delphi Language Chapter teasers from Jon Shemitz’ .NET 2.0 for Delphi Programmers book. Last time we looked at the .NET and Win32 differences for untyped var and out parameters. Here we look at casting issues. Note that I do not get any royalties from the book and I highly recommend that you get your own copy – for instance at Amazon. "Casting There Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com0tag:blogger.com,1999:blog-6977069.post-80340029184433254672007-10-17T16:46:00.001+02:002007-10-20T22:10:17.497+02:00More fun with EnumeratorsAs part of the new language syntax inherited from Delphi.NET, native Delphi now (since Delphi 2005) supports for-in loops (known as foreach in C#). The new syntax is easy to read, and it reduces the clutter of maintaining a loop index variable, checking boundary conditions (typically 0 and Count-1) and indexing into the array or list. While Delphi has special built-in Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com17tag:blogger.com,1999:blog-6977069.post-37746220604299115702007-10-07T13:37:00.001+02:002007-10-28T09:36:59.575+01:00DN4DP#24: .NET vs Win32: Untyped parametersThis post continues the series of The Delphi Language Chapter teasers from Jon Shemitz’ .NET 2.0 for Delphi Programmers book. The previous post listed the Win32 specific language and RTL features. The next few posts will focus on minor differences in implementation between Win32 and .NET - starting with differences in the detailed semantics of untyped var and out parameters. Note that I do Hallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com0tag:blogger.com,1999:blog-6977069.post-5457608731895282842007-10-05T22:08:00.001+02:002007-10-05T22:08:22.956+02:00DN4DP#23: .NET only: Obsolete featuresThis post continues the series of The Delphi Language Chapter teasers from Jon Shemitz’ .NET 2.0 for Delphi Programmers book. The previous post showed how to use the mysterious P/Invoke features. This time we'll list the Win32 specific features of the language and RTL that didn't make it to the .NET side. Note that I do not get any royalties from the book and I highly recommend that you getHallvards New Bloghttp://www.blogger.com/profile/09527199955524812466noreply@blogger.com1