在制作activex控件时如何获得自己定义的属性值?得到答案以后立刻给分。(50分)

J

jieson

Unregistered / Unconfirmed
GUEST, unregistred user!
在get_xxx函数里应该写什么?
自动生成的代码里是直接把属性名赋给result的
比如
function TSoftPhoneX.Get_Scaled: WordBool;
begin
Result := Scaled;
end;
但是自己定义的属性这么赋值就会报错undeclared identifier。
该如何解决呢?


 
谁做过activex啊?帮帮忙吧!以前的帖子我也找过了,实在是解决不了。
现在我就这么点分了,以后我有分了会报答你们的!
 
upupupupup
 
You must declare a published property and such as:
published
UserDefined : string read getdefine write setdefine
 
你得确定有没有Scaled这个变量。

建议你不要手工添加published属性,虽然这样不会错,但是这样,ActiveX控件对外是不会有这个属性的。
 
You can get some help refer to Delphi Developer's Guide about Active Control.
You declare a published property and attach it with 2 method which Delphi will create for you
 
对于写vcl控件的操作,不能都用于做activex的,romi那么做根本不行
往activex中添加属性只有两中方法,我只知道两中,都是自动添加的,而不是手工写。
因为必须跟改tlb文件才能生效。
 
在_tlb 文件中需定义Get_Scaled
 
这个我知道,但是当属性更新的时候,值其实并没有更新啊。
就是说在设计时给属性敷值,但运行后还是默认值
而且_tlb文件里不能定义集合类型。
 
算乐 ,揭贴了
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
448
import
I
I
回复
0
查看
535
import
I
顶部