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.
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.
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 AMAdd Your Comment
