BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

simple interface don't know why i'm getting errors

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Language ObjectPascal
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Wed Mar 01, 2006 3:03 pm    Post subject: simple interface don't know why i'm getting errors Reply with quote



I tried the following and i'm getting the EOleError 'Object factory for
class TActionItem missing'.

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?
Back to top
Riki Wiki
Guest





PostPosted: Sun Mar 05, 2006 4:03 am    Post subject: Re: simple interface don't know why i'm getting errors Reply with quote



On 1 Mar 2006 06:55:45 -0800, dancomp71 (AT) aol (DOT) com wrote:

Quote:
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>
Back to top
ZipBreak
Guest





PostPosted: Mon Mar 27, 2006 7:05 am    Post subject: Re: simple interface don't know why i'm getting errors Reply with quote



Quote:
TActionItem = class(TComObject, IActionItem)
function GetName : String;
end;

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
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Language ObjectPascal All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.