Back to index
|A sample of XPConnect. |
|void||writeValue (in string aPrefix)|
|void||poke (in string aValue)|
|This macro expands into a declaration of the nsISupports interface. |
This macro expands into a declaration of the nsISupports interface.
Every XPCOM component needs to implement nsISupports, as it acts as the gateway to other interfaces this component implements. You could manually declare QueryInterface, AddRef, and Release instead of using this macro, but why? This macro is defined in the nsISample.h file, and is generated automatically by the xpidl compiler. It expands to declarations of all of the methods required to implement the interface. xpidl will generate a NS_DECL_[INTERFACENAME] macro for each interface that it processes.
The methods of nsISample are discussed individually below, but commented out (because this macro already defines them.) The following is an explanation of how the interface header file expands to for a c++ implementation. NS_DELC_NSISAMPLE takes care of defining the right c++ implementation.
The following if provided for more understanding.