program FWTest02;
{$APPTYPE CONSOLE}
uses
ExceptionLog,
SysUtils
, ComObj
;
type
IActionItem = interface
function GetName : String;
end;
TActionItem = class(TComObject, IActionItem)
function GetName : String;
end;
var
ai : IActionItem;
{ TActionItem }
function TActionItem.GetName: String;
begin
Result := 'ActionItem';
end;
begin
ai := TActionItem.Create;
writeln(ai.GetName);
end.
what am i doing wrong?
> what am i doing wrong?
Hoi Dan
You need to repost your question on the Borland news server to make
everybody see it and possibly answer your question. Further, this news
group do not officially exist, the group to use is
b.p.d.language.delphi.general.
Take a look here:
<http://tinyurl.com/8m5nw>
which links to
<http://delphi.wikicities.com/wiki/Delphi_Newsgroups>
Inherit from TInterfacedObject NOT from TComObject. TComObject will
require you to initialize the COM subsystem of Windows -- which is a
waste since you're just using your interfaces internally.
Cheers,
Vij