Microsoft DirectX 8.0 |
Base class for implementing the IDispatch interface.
Declaration: Ctlutil.h
This class is limited to supporting the Automation-compatible interfaces exported by the DirectShow type library, QuartzTypeLib. For example, the CMediaControl and CMediaPosition classes use CBaseDispatch to implement IMediaControl and IMediaPosition, respectively. Because of this limitation, there is probably no reason to use CBaseDispatch directly in your own filters.
To use this class, do the following:
For more details, refer to the source code for any of the sample classes declared in Ctlutil.h.
For more information about the IDispatch methods, see the COM documentation included with the Microsoft® Platform SDK.
Public Methods | |
---|---|
CBaseDispatch | Constructor method. |
~CBaseDispatch | Destructor method. |
GetIDsOfNames | Maps a set of names to a corresponding set of DISPIDs. |
GetTypeInfo | Retrieves the type information for the object, which can then be used to get the type information for an interface. |
GetTypeInfoCount | Retrieves the number of type information interfaces the object provides. |
Constructor method.
Syntax
CBaseDispatch(void);
Destructor method.
Syntax
~CBaseDispatch(void);
Maps a set of names to a corresponding set of DISPIDs.
Syntax
HRESULT GetIDsOfNames( REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid );
Parameters
- riid
- Reference to an interface identifier (IID) that specifies the interface.
- rgszNames
- Address of an array of wide-character strings that contain the names to be mapped.
- cNames
- Size of the array given by the rgszNames parameter.
- lcid
- Locale context in which to interpret the names. Can be NULL.
- rgdispid
- Pointer to an array that receives the DISPIDs. Each element of receives an identifier that corresponds to one of the names passed in the rgszNames parameter.
Return Value
Returns an HRESULT value. Possible values include the following.
S_OK Success. E_OUTOFMEMORY Insufficient memory. DISP_E_UNKNOWNNAME One or more of the names were not known.
Remarks
This method behaves like the IDispatch::GetIDsOfNames method, but the riid parameter specifies the interface on which to retrieve DISPIDs. (In the IDispatch version, the riid parameter is reserved.)
If the method returns DISP_E_UNKNOWNNAME, the returned DISPIDs contain DISPID_UNKNOWN for each entry that corresponds to an unknown name.
Retrieves the type information for the object, which can then be used to get the type information for an interface.
Syntax
HRESULT GetTypeInfo( REFIID riid, UINT itinfo, LCID lcid, ITypeInfo **pptinfo );
Parameters
- riid
- Reference to an interface identifier (IID) that specifies the interface.
- itinfo
- Type information to return. Must be zero.
- lcid
- Locale identifier.
- pptinfo
- Address of a variable that receives an ITypeInfo pointer.
Return Value
Returns an HRESULT value. Possible values include the following.
S_OK Success. E_POINTER Null pointer argument. TYPE_E_ELEMENTNOTFOUND The itinfo parameter is not zero.
Remarks
This method behaves like the IDispatch::GetTypeInfo method. However, it includes an additional parameter, riid, which specifies the interface for which to retrieve type information.
Retrieves the number of type information interfaces the object provides.
Syntax
HRESULT GetTypeInfoCount( UINT *pctinfo );
Parameters
- pctinfo
- Pointer to a variable that receives the number of type-information interfaces provided by the object. When the method returns, the value is 1.
Return Value
Returns one of the following values.
S_OK Success. E_POINTER Null pointer argument.