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

property: accessor and mutator

7 views
Skip to first unread message

Matej Spiller

unread,
Dec 9, 2001, 1:24:09 PM12/9/01
to
Is there any way I can access accessor and mutator of propery that is marked
as public, not published.
The problem is because I can't use Typinfo on COM objects (interfaces). I
would need to use interface property as var (or out) parameter in some
SetValue procedure.
Well if I can access accessor and mutator of propery like with TypInfo, then
everything is solved, because tlbimp creates classes that are derived from
interfaces and they then calls COM objects.

I need this, because I have around 100 of properties in one interface and I
have to do some error and type checking for each of them. General idea is to
have one procedure SetValue for each basic type of property (String,
Integer). And then I can call SetValue (baseclass.someprop). Or something
like that. I can not perform checking on COM site, because I do some form
based checking too.

Another solution is to somehow persuade delphi to use interface property as
parameter in proc. Something like this:
....
var xxxx: Variant
begin
xxxx := ComObj as ISomeinterface;
xxxx.Prop = 'test'; //this works fine
//but I need something like this
SetValue (xxxx.Prop) or SetValue (xxxx, Prop);
...

...
procedure SetValue (xx:Variant; prop: ??????; value:String);
begin
//some checking
xx.prop = value;
end;
...
Or do I have to use Com Dispatch (Invoke) (Need an example).

Any ideas?

thanks, Matej Spiller


0 new messages