Passing an Object as an Interface
- by Christopher Chase
This should be a simple answer, i believe its going to be a no,
but taken from a larger project, i have an interface and the procedure
iMyUnknown= interface(IInterface)
['..GUID..']
end;
procedure WorkObject(iObj :iMyUnknown);
i know this works
var
MyUnknown : iMyUnknown;
begin
if supports(obj, iMyUnknown, MyUnknown) then
WorkObject(MyUnknown);
But is it possible to do something like this?
if supports(obj, iMyUnknown) then
WorkObject(obj as iMyUnknown);