Board index » delphi » why interface casting can burn in...
Simian Jones
![]() Delphi Developer |
Wed, 11 Aug 2004 05:45:08 GMT
why interface casting can burn in...
I just have to rant a bit here on a problem that had me pulling my hair out
for the last 5 hours. I had very simple design, something like this: IDocument = interface; Then I used everyone's favorite IInterfaceList to keep track of all var procedure TForm1.RiddleMeThis; // add interface to list // get the first document in the list // get the index of the first object(obviously this is From the above code I'd expect that the variable 'index' would be set to 0 The resolution is to be highly redundent. When adding the variable 'doc' to GlobalList.Add( doc as IDocument ); Anyone out there tell me why I have to cast my variable as it's own type Simian |