|
This function creates an instance of the component that this factory is implemented to manage. Note that if there is any problem creating the component, or querying the requested interface from it, iPtr is set to NULL, and this function returns one of the values from IBase::Status to identify the problem. IBase::cOK is returned if no problems are encountered.
- Parameters:
-
reserved | This parameter is reserved for advanced usage of components. It represents the "outer object" in an aggregation relationship. For simple, non-aggregated components, this parameter must be set to NULL. |
id | This is a reference to the class id of the required interface. Note that if the component does not implement this interface, the factory deletes the instance it created and sets iPtr to NULL. If the particular interface that the component implements is not known (for instance, it may be another version of an interface, but both may not be available) the best strategy is to create the component and request the IBase interface, which is guartanteed to be implemented. Then, queryInterface can be used to determine which particular version of the interface is implemented. |
*iPtr | This parameter is set to a pointer to the requested interface from the new component, or NULL if there was a problem creating the component, or if the required interface is not implemented by this compoinent. |
Implemented in Factory. |