CBaseDispatch Class

CBaseDispatch class hierarchy

The CBaseDispatch class is a base class that implements the IDispatch interface for use in a dual interface. A dual interface provides Automation and custom interface access to an interface.

CMediaControl and CMediaPosition (and other dual-interface support classes) are derived from this class or have members that are instances of this class.

For more information about the IDispatch methods, see the COM documentation included with the Microsoft® Platform Software Development Kit (SDK).

Member Functions

CBaseDispatch Constructs a CBaseDispatch object.

Implemented IDispatch Methods

GetIDsOfNames 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 IDispatch::Invoke method.
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.

CBaseDispatch::CBaseDispatch

CBaseDispatch Class

Constructs a CBaseDispatch object.

Syntax

CBaseDispatch(void);

Return Value

No return value.

CBaseDispatch::GetIDsOfNames

CBaseDispatch Class

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 IDispatch::Invoke method.

Syntax

HRESULT GetIDsOfNames(

  REFIID riid,
  OLECHAR **rgszNames,
  UINT cNames,
  LCID lcid,
  DISPID *rgdispid
  );

Parameters

riid
Reference identifier. Reserved for future use. Must be NULL.
rgszNames
Address of a pointer to a passed-in array of names to be mapped.
cNames
Count of the names to be mapped.
lcid
Local context in which to interpret the names.
rgdispid
Pointer to a caller-allocated array, each element of which contains an identifier that corresponds to one of the names passed in the rgszNames parameter. The first element represents the member name; the subsequent elements represent each of the member's parameters.

Return Value

Returns one of the following values.
S_OK Success.
E_OUTOFMEMORY Out of memory.
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.
DISP_E_UNKNOWN_CLSID The class identifier was not recognized.

CBaseDispatch::GetTypeInfo

CBaseDispatch Class

Retrieves a type-information object, which can retrieve the type information about an interface.

Syntax

HRESULT GetTypeInfo(

  UINT itinfo,
  LCID lcid,
  ITypeInfo **pptinfo
  );

Parameters

itinfo
Type information to return. Pass zero to retrieve type information for the IDispatch implementation.
lcid
Local identifier for the type information. An object can return different type information for different languages. This capability is important for classes that support localized member names. For classes that do not support localized member names, ignore this parameter.
pptinfo
Address of a pointer to the type-information object requested.

Return Value

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:
E_FAIL Failure.
E_POINTER Null pointer argument.
E_INVALIDARG Invalid argument.
S_OK or NOERROR Success.

CBaseDispatch::GetTypeInfoCount

CBaseDispatch Class

Retrieves the number of type-information interfaces provided by an object.

Syntax

HRESULT GetTypeInfoCount(

  UINT *pctinfo
  );

Parameters

pctinfo
Pointer to the location that receives the number of type-information interfaces that the object provides. If the object provides type information, this number is 1; otherwise, the number is 0.

Return Value

Returns E_POINTER if pctinfo is invalid; otherwise, returns S_OK.


Top of Page Top of Page
© 2000 Microsoft and/or its suppliers. All rights reserved. Terms of Use.