The way interfaces work in Delphi for Win32 stinks. From what I have read it seems that interfaces were forced in to work with COM. But even if you are not using COM, interfaces imposes COM like behaviors such as ref counts and interfaces must have a GUID. But what really ticks me off is that you cannot cast an interface to an object.

For years I have abstracted framework and application features through interfaces. Now I can't use them and it means I have to change the way I think. This limitation, which I wish I knew about 2 months ago, makes me think I should have used C# for my app.

In the end, I will be happy with my selection of Delphi. But I'm a bit ticked off at it for the moment.

For those using Delphi for .NET, this will not be a problem. Interfaces work the way you would expect, and you can cast objects to interfaces and interfaces to objects.

posted by Kirby Turner | 04-May-2005 6:45 PM | comments (2)


K,
I coulda run through this with you ahead of time. I went through same stuff TRYING interfaces in Delphi, only to determine they are useless. Better to just use a good class-hierarchy.

posted by Mike | May 13 10:02 AM


Yeah, I learned it the hard way. I was hoping to use interfaces so my Win32 and .NET code would be similar.

posted by Kirby Turner | May 13 10:10 AM

Add Your Comment

Comment:
(No HTML)

Name:
E-mail/Web site:
Your e-mail/web site will not be published on this site. It is optional and will only be used by me should I need to contact you directly.
 
By checking this option, this site will remember your name and e-mail/web site on future visits. Uncheck this option to have the site not remember who you are on future visits.
 
Enter the code shown above:
Copyright © 1999-2008 Kirby Turner.
Site software written by White Peak Software Inc, a provider of custom software and software development coaching.