Caves Travel Diving Graphics Mizar Texts Cuisine Lemkov Contact Map RSS Polski
Trybiks' Dive Texts Delphi YAC Software












Rhino Mocks



UI Testing




  • Delphi interfaces... again
    Another problem with interfaces and reference counting in Delphi - passing self of the interfaced object to a method call...

  • Checking "Dangling" Event Handlers in Delphi Forms
    I like Visual Form Inheritance (VFI) in Delphi, but the tool support could be much better. One things that like to get out of sync. when working on form hierarchies is event handler mappings between events and the respective procedures. Here's a small procedure that will check any discrepancies in that area.

  • Drag-n-drop files onto the application window
    A short description of the implementation (in Delphi) of the application's main window that accepts files dragged and dropped from outside of the program (e.g. from Windows Explorer).

  • Intraweb and MaxConnections
    Having problems with running out of connections in Intraweb? Check out my solution - maybe it will help.

  • A Case for FreeAndNIL
    Allen Bauer, Embarcadero Chief Scientist, wrote an interesting blog entry - A Case Against FreeAndNIL. Though I agree with the general gist of that article (when fixing a defect, don't fix the symptoms, but find out what the root cause of the problem is and fix that), I don't agree at all that the problem here is in FreeAndNIL usage. IMO, FreeAndNIL can help in tracking defects down and should be considered a mandatory coding guideline.

  • Intraweb as an Apache DSO module
    Always when I tried to upload a Apache module written in Delphi / Intraweb (VCL for the Web), something didn't work quite as expected. Either the service didn't want to start, or Apache couldn't find / run the module, etc. Apart from the required changes to HTTPD2.pas (that depend on the specific version of your Apache installation), you also need to configure access to your module in the httpd.conf file. And this texts should just how to do that.

  • "Device not supported" in Intraweb
    Getting a "Device not supported" exception when running your Intraweb (VCL for the Web) application in a standard web browser? One possible cause is described in this short text.

  • Automated GUI Testing
    Ever head problems with testing GUI applications using an external testing program? Or maybe you just want to test a single window/form without the need of running your whole program? Start unit testing you GUIs - it's as simple as standard unit tests.

  • Rounding and precision on the 8087 FPU
    After moving my testing to a virtual machine it turned out that newly generated results of statistical calculations differ from reference results (calculated and saved earlier). Although the differences appear on the least significant digits of floating-point values, the root cause of the problem was unknown to me, thus to serious to be ignored. It turns out that results of calculations may depend on the Intel's numerical coprocessor's control word. The issue is discussed in more detailed in the text.

  • SessionTimeout in Intraweb
    A solution to better handling of Intraweb's session timeouts and automatic destruction of inactive user sessions.

  • Using TChart with Intraweb
    A method for displaying TChart charts in Delphi applications based on the Intraweb (VCL for the Web) framework.

  • Unknown driver: MySQL
    Getting an "Unknown driver: MySQL" message in your Delphi application?
    Just add DBXMySql to the uses clause!

  • TIdMessage's CharSet
    Wanted to encode a TIdMessage in Delphi using some ISO character set, like, for instance, ISO-8859-2? And had problems with that? This text should help at least some of you (I hope).

  • Software Guarantees
    If you are a customer of software applications, if these don't work as advertised, and you can't get bug fixes for free and in a timely manner - dump them! Software developers aren't so special not to be responsible for their work. Software guarantees will not annihilate IT! So, go ahead and vote with your wallet!

  • Automated Testing of Window Forms
    Tired of continuously verifying tab orders and accelerators in your window forms? How many times have you shipped a program that duplicates shortcuts, doesn't have FocusControl assigned in labels, doesn't have default buttons in dialog windows, etc.? Well, this text describes an approach for automatic testing of window forms (and other controls, for that matter). An approach that, at least for me, saves hours of testing time each week.

  • TChart - Missing Labels in Axes
    Description of the problem and the solution of missing labels in TChart axes when different numbers of values are added to the chart's data series.

  • Memory Leaks and Connection Explosions in DBExpress
    Delphi 2009 fixes both problems when accessing MySQL via DBExpress. However, if you're still on Delphi 2007 and are experiencing one of these problems, you may want to try the fix in D2007 that was added to DBExpress in D2009.

  • Controlling Conditional Defines and Compilation Switches
    An idea on how to augment software build / release processes by automatically checking compilation settings and combinations of conditional defines during compilation.

  • Detecting Memory Leaks with DUnit
    It's much easier to fix coding faults when these are discovered in the unit testing phase than when they're discovered in further phases of the development cycle. A category of such defects - memory leaks - are usually hard to track down because of their irregular behavior. Then, tracking down the root cause of the problem is often difficult and time consuming.

    When programming in Delphi, DUnit is the obvious choice for unit testing, and thanks to its memory leak detector, helps in the problem mentioned above (and, for other languages, similar unit testing frameworks can be used). However, there are certain caveats to deal with here, and one of these is discussed in the article.

  • last_insert_id() and DBExpress
    MySQL's last_insert_id() function gets the last automatically generated value for a given table. That's pretty helpful, for instance, when you're inserting records and want to retrieve their newly generated IDs. I spent some time on solving this in Delphi's DBExpress framework, and this text documents the issue.

  • Registering Extensions
    Delphi code for registering application-specific file extensions in Windows.

  • DBExpress and Thread Safety
    Description of the problem and the workaround of intermittent Access Violation errors on WideStrings.TWideStrings.GetValue and System.TObject.Free when using DBExpress components for communication with MySQL databases (under heavy load).

  • Forms as Frames
    Placing standard forms (TForm) as frames on other forms.

  • Checking Dangling Pointers vs. the New Memory Manager
    Description of the problem and the solution of intermittent Access Violation errors when using DBExpress components for communication with MySQL databases.

  • Accessing Protected Members
    The text describes a simple trick for accessing protected members of instantiated classes without instantiating descendants of those classes - descendants that would make these protected members public.

  • Objects, interfaces, and memory management in Delphi
    Who, for Pete's sake, designed interfaces in Delphi? Did that person had the least idea what interfaces are good for (except for COM) and how their idea can be integrated with tons and tons of legacy code? Code, where since always, even since Turbo Pascal days, memory for you own objects had to be allocated, and deallocated, explicitly? Well, sir/madam, it wouldn't be that easy to get it more wrong!