Using XPCOM Objects

Using XPCOM Objects

Instanciating XPCOM Objects

An instance of XPCOM component can be obtained by XPCOM.instance methods.

file = XPCOM.instance(";1", "nsILocalFile")

You can also ask a service for the ServiceManager.

category_manager =
XPCOM::ServiceManager is reference to the global service manager. It support nsIServiceManager interface. getServiceManager method is wrapped, specially so that it accept an interface name as well as IID.


Methods defined nsISupports are treated specially.


QueryInterface accepts interface name as well as iid. It returns nil if the reciever does not support specified interface (rather than raising an exception).


not visible from Ruby


not visible from Ruby