The CMediaPosition class is a base class that handles the IDispatch methods of the dual-interface IMediaPosition. It leaves the properties and methods as pure virtual.
The CMediaPosition::GetIDsOfNames, CMediaPosition::GetTypeInfo, CMediaPosition::GetTypeInfoCount, and CMediaPosition::Invoke methods are standard implementations of the IDispatch interface using the CBaseDispatch class (and a type library) to parse the commands and pass them to the pure virtual IMediaPosition methods.
Member Functions
| Name | Description |
| CMediaPosition | Constructs a CMediaPosition object. |
Implemented INonDelegatingUnknown Methods
| Name | Description |
| NonDelegatingQueryInterface | Returns a specified reference-counted interface. |
Implemented IDispatch Methods
| Name | Description |
| GetIDsOfNames | Maps a single member and an optional set of parameters to a corresponding set of integer dispatch identifiers, which can be used during subsequent calls to the CMediaPosition::Invoke member function. |
| GetTypeInfo | Retrieves a type-information object, which can retrieve the type information for an interface. |
| GetTypeInfoCount | Retrieves the number of type-information interfaces provided by an object. |
| Invoke | Provides access to properties and methods exposed by an object. |
Constructs a CMediaPosition object.
CMediaPosition(
const TCHAR *pName,
LPUNKNOWN pUnk
);
No return value.
Allocate the pName parameter in static memory. This name appears on the debug terminal upon creation and deletion of the object.
Maps a single member function and an optional set of parameters to a corresponding set of integer dispatch identifiers, which can be used upon subsequent calls to the CMediaPosition::Invoke member function.
HRESULT GetIDsOfNames(
REFIID riid,
OLECHAR ** rgszNames,
UINT cNames,
LCID lcid,
DISPID * rgdispid
);
Returns one of the following values.
| Value | Meaning |
| DISP_E_UNKNOWN_CLSID | The CLSID was not recognized. |
| DISP_E_UNKNOWNNAME | One or more of the names were not known. The returned DISPIDs contain DISPID_UNKNOWN for each entry that corresponds to an unknown name. |
| E_OUTOFMEMORY | Out of memory. |
| S_OK | Success. |
Retrieves a type-information object, which can retrieve the type information for an interface.
HRESULT GetTypeInfo(
UINT itinfo,
LCID lcid,
ITypeInfo ** pptinfo
);
Returns an E_POINTER if pptinfo is invalid. Returns TYPE_E_ELEMENTNOTFOUND if itinfo is not zero. Returns S_OK if is successful. Otherwise, returns an HRESULT from one of the calls to retrieve the type. The HRESULT indicates the error and can be one of the following standard constants, or other values not listed:
| Value | Meaning |
| E_FAIL | Failure. |
| E_POINTER | Null pointer argument. |
| E_INVALIDARG | Invalid argument. |
| S_OK or NOERROR | Success. |
Retrieves the number of type-information interfaces provided by an object.
HRESULT GetTypeInfoCount(
UINT * pctinfo
);
Returns E_POINTER if pctinfo is invalid; otherwise, returns S_OK.
Provides access to properties and methods exposed by an object.
HRESULT Invoke(
DISPID dispidMember,
REFIID riid,
LCID lcid,
WORD wFlags,
DISPPARAMS * pdispparams,
VARIANT * pvarResult,
EXCEPINFO * pexcepinfo,
UINT * puArgErr
);
Returns DISP_E_UNKNOWNINTERFACE if riid is not IID_NULL. Returns one of the error codes from CMediaPosition::GetTypeInfo if the call fails. Otherwise, returns the HRESULT from the call to IDispatch::Invoke.
Returns a specified reference-counted interface.
HRESULT NonDelegatingQueryInterface(
REFIID riid,
void **ppv
);
Returns E_POINTER if ppv is invalid. Returns NOERROR if the query is successful or E_NOINTERFACE if it is not.
Returns a pointer to IMediaPosition and IUnknown interfaces by default. Override this member function to publish any additional interfaces implemented by the derived class.
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.