Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Publishing properties in ActiveForm

3 views
Skip to first unread message

JD

unread,
Feb 28, 2008, 2:25:39 PM2/28/08
to
When I put properties in the published section of an ActiveForm's
implementation, the compiler wants the calling convention to be "register."
How can I set that in the Type Library editor (can't change the text in the
TLB; the editor keeps overwriting it).

Remy Lebeau (TeamB)

unread,
Feb 28, 2008, 2:31:59 PM2/28/08
to

"JD" <shan...@attglobal.net> wrote in message
news:47c7...@newsgroups.borland.com...

> When I put properties in the published section of an ActiveForm's
> implementation, the compiler wants the calling convention to
> be "register."

Please show the actual code and error message.

> How can I set that in the Type Library editor

You can't, nor should you be trying to. Anything that is exposed via COM
has to use stdcall or safecall instead.


Gambit


JD

unread,
Feb 28, 2008, 2:42:37 PM2/28/08
to
type
SomeActiveForm = class(TActiveForm, ISomeInterface)
...

private

function Get_ShowFileList: WordBool; safecall; register;
procedure Set_ShowFileList(const Value: WordBool); safecall; register;
function Get_ShowControlPanel: WordBool; safecall; register;
procedure Set_ShowControlPanel(const Value: WordBool); safecall;
register;

published

property ShowFileList: WordBool read Get_ShowFileList write
Set_ShowFileList;
property ShowControlPanel: WordBool read Get_ShowControlPanel write
Set_ShowControlPanel;

end;

The compiler insists on the "register" keyword. WIthout it:

[DCC Error] uSomeImpl.pas(225): E2270 Published property getters and setters
must have REGISTER calling convention

But now I'm thinking... these "published" properties aren't just going to
show up in the ActiveX the way they do in a component, now are they... COM
makes my head hurt...


"Remy Lebeau (TeamB)" <no....@no.spam.com> wrote in message
news:47c70c1e$1...@newsgroups.borland.com...

Remy Lebeau (TeamB)

unread,
Feb 28, 2008, 4:20:18 PM2/28/08
to

"JD" <shan...@attglobal.net> wrote in message
news:47c70f0a$1...@newsgroups.borland.com...

> [DCC Error] uSomeImpl.pas(225): E2270 Published property
> getters and setters must have REGISTER calling convention

That means using fastcall (Delphi's default convention) instead of using
safecall.

Why are you publishing your properties in the first place, though? They
should be public instead.

> But now I'm thinking... these "published" properties aren't just going
> to show up in the ActiveX the way they do in a component, now are
> they...

No. They have to be declared in the ActiveX's Type Library in order for
clients to use them. There is no such thing as "published" in COM.


Gambit


JD

unread,
Feb 28, 2008, 6:09:11 PM2/28/08
to
Thanks, it has been a while since I've worked with Active X's.

"Remy Lebeau (TeamB)" <no....@no.spam.com> wrote in message

news:47c7...@newsgroups.borland.com...

0 new messages