Tag: Delphi


New Technologies Trends

I have written before a short comparison between “old” and newer technologies, but at the beginning of that post I state that part of the choice of a new technology is the market trend towards that technology.
After reading Justin’s post showing that moving to ASP.NET is beneficiary because it’s becoming a prominent technology I decided to implement his research methods (using Google) on different technologies.

I began by searching for file types

However, this reflects only on files shared on the web, and since JAVA is a web technology (unlike Delphi) the results don’t say much.

But Google trends provides a clearer picture - while C# remains stable, other programming languages are on the decline:

Focusing on the .Net world, you can clearly see new technologies are dominant in Google searches:

WPF vs. Winforms

WCF vs. Remoting

The rise of .Net Framework 3.0 technologies

With Silverlight being the “Hot New Thing” (maybe because it’s a web-based technology)

So maybe choosing a new technology is a logical move even if it doesn’t offer a significant technological advantage - since keeping older technologies means you are working against the market trend.

So consider switching from Winforms to WPF, from various communication technologies to WCF and from VS 2003 or 2005 to VS 2008 - in the long run the market will force you to do it anyway, either through the job market or through customers demands.

Comment » | Technology, Visual Studio, WCF, WPF, Winforms

Some Delphi Stuff

  • If you are using DUnit for unit tests, consider the DUnitLite and DSpec addons.
  • Read this post regarding calling .Net code from Win32 Delphi using C++ code (another way do to this is using COM objects)
  • This is why you should move to C#.

Comment » | TDD

Free help line for Delphi 2007 for Win32 on 29/3/2007

I just got this mail:

To all Registered Delphi 2007 for Win32 Developers,Mark your calendars for this one-time only, online exclusive FREE event!

OnThursday, March 29th (for registered users of Delphi 2007 for Win32), you’re invited to spend a virtual day with the engineering team that developed Delphi2007 for Win32.

This is your chance to get answers to your toughest Win32 development challenges– directly from the team that created Delphi 2007 for Win32. Whether it’s Windows Vista, XP, or 2000, AJAX or VCL for the Web – you’ll get theanswers you need to give you the edge, share tips and tricks with your colleagues, and meet the luminaries that are blazing new trails in Win32development.

You can find more details here.

Comment » | Uncategorized

Exception callstack in Delphi

One of the great thing about .Net is getting the callstack with minimum effort.
Unlike .Net, Delphi developers must rely on other methods to locate the location of an exception.
However, there is a way to get the call stack on Delphi exception.
You can download Jiri Hajek’s unit for this purpose, which also includes logging the exceptions to a file.
For this to work you also need to enable the “Stack frames” and “TD32 debug info” parameters in the project settings.
Here is something I wrote based on Jiri’s code, which directs the callstack output to another method, allowing actions other than file write:

unit ExceptionLog;

interface

uses Classes, MemCheck;

type
TOnException = procedure(CallStack : String) of object;

ExceptionHandler = class
private
FOnException: TOnException;
Function GetOnException : TOnException;
Procedure SetOnException(value: TOnException);
procedure Init;
Constructor Create;
public
Class Function GetInstance : ExceptionHandler;
Property OnException: TOnException read GetOnException write SetOnException;
end;

implementation
var

oldRTLUnwindProc : procedure; stdcall;
OInstance : ExceptionHandler;

{ ExceptionHandler }
constructor ExceptionHandler.Create;

begin
FOnException := nil;
end;

Class Function ExceptionHandler.GetInstance: ExceptionHandler;
begin
if OInstance = nil then OInstance := ExceptionHandler.Create;
result := OInstance;
end;

function ExceptionHandler.GetOnException: TOnException;
begin
Result := FOnException;
end;

procedure ExceptionHandler.SetOnException(value: TOnException);
begin
FOnException := value;
end;

procedure HandleOnException; stdcall;
var CS: TCallStack;
begin
FillCallStack(CS, 4);
Try
ExceptionHandler.GetInstance.OnException(CallStackTextualRepresentation(CS, ”));
Except
End;
asm
mov esp, ebp
pop ebp
jmp oldRTLUnwindProc
end; //asm
end; //HandleOnException

procedure ExceptionHandler.Init;
begin
oldRTLUnwindProc := RTLUnwindProc;
RTLUnwindProc := @HandleOnException;
end;

initialization
ExceptionHandler.GetInstance.Init;

end.

Usage:

  1. Add this unit to the “uses” section of your main unit
  2. Create a method with the “TOnException” (below) signature
  3. Connect the method to this class (Example: “ExceptionHandler.GetInstance.OnException := MyMethod“)

Comment » | Uncategorized