Thread View: borland.public.delphi.vcl.components
1 messages
1 total messages
Started by Matej Spiller
Sun, 09 Dec 2001 18:24
property: accessor and mutator
Author: Matej Spiller
Date: Sun, 09 Dec 2001 18:24
Date: Sun, 09 Dec 2001 18:24
39 lines
2660 bytes
2660 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads