Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange Interface Definition in Delphi 1

Status
Not open for further replies.

apostolchopov

Programmer
Jun 8, 2004
53
BG
Hi, fellows!
In on the files installed during Delphi setup called 'Rio.h' I noticed a strange and unacceptable (in my view) interface definition. In this file are defined clases, interfaces, etc. that support the Web Service integration into Delphi. So, I came upon the following strange piece of code:

IRIOAccess = interface
['{FEF7C9CC-A477-40B7-ACBE-487EDA3E5DFE}']
function GetRIO: TRIO;
property RIO: TRIO read GetRIO;
end;

This piece of code really breaks the protocol established by COM. Each COM interface must contain IUknown's methods QueryInterface, AddRef and Release. Therefore, this is not a COM interface. Why its existence is allowed in Delphi?

How could this happen in Delphi?

Regards!
 
The following quote extracted from Delphi help should answer your question

...If no ancestor is specified, the interface is a direct descendant of IInterface, which is defined in the System unit and is the ultimate ancestor of all other interfaces. On Win32, IInterface declares three methods: QueryInterface, _AddRef, and _Release. These methods are not present on the .NET platform, and you do not need to implement them.
...

IInterface is equivalent to IUnknown. You should generally use IInterface for platform independent applications and reserve the use of IUnknown for specific programs that include Win32 dependencies...



"It is in our collective behaviour that we are most mysterious" Lewis Thomas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top