Hi Andrzej, Andrzej Wytyczak-Partyka wrote:
> At this point I finally understood ( at least so I think... ;-) ) what's > going on here. > Each time I want some interface from a component I have to query it to get > it, right? In its entirety this statement goes too far. ;-) Of course you don't need to do this if the interface you want to use is a base class interface of the one you have. As an example, if you have a Reference <css.frame.XFrame> you can use it as a Reference <css.lang.XComponent> directly (and e.g. call "addEventListener" on it) because css.lang.XComponent is a base class of css.frame.XFrame. > like here - I want an XPropertySet interface, so I query the > MultiServiceFactory object > which returns a XPropertySet reference. Why can't I use casts? Like : > (XPropertySet(m_xSMGR))->somePropertySetSpecificMethod() ? The main reason for not using casts is that they don't work for remote calls and UNO should be "remote transparent". For casts you need information about the implementation class, either its class definition (for static casts) or its "Runtime Type Information(RTTI)" (for dynamic casts). Both is not available in a remote client application. Theoretically you could use dynamic casts instead of queryInterface calls when instantiating services implemented in C++ in-process, but the client code shouldn't depend on the implementation language or process location of the service it uses, do this theoretical option is not used. UNO offers its own way of "RTTI", it consists of the XTypeProvider interface (for dynamic, inspectional type access) and the "queryInterface" call. Ciao, Mathias -- Mathias Bauer - OpenOffice.org Application Framework Project Lead Please reply to the list only, [EMAIL PROTECTED] is a spam sink. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]