Partager via


GetInterface Method

GetInterface Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

The GetInterface method returns the specified dual interface on the object.

Applies To

IMailboxStoreDB Interface

Type Library

Microsoft CDO for Exchange Management Library

DLL Implemented In

CDOEXM.DLL

Syntax

[Visual Basic]Function GetInterface
(
    Interface As String
) As Object

[C++]HRESULT GetInterface (     BSTR Interface,     IDispatch** pVal );

Parameters

  • Interface
    The name of the interface to obtain.
  • pVal
    A pointer to the interface.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

The GetInterface method is primarily intended as a generic interface navigation aid to scripting languages that do not support such navigation directly. Most Component Object Model (COM) classes that provide implementations of the IMessage Interface expose additional dual interfaces that are accessible by scripting languages only through properties on the interface, such as BodyPart Property and DataSource Property, or through the GetInterface method. When properties do not exist on the interface to return these interfaces, the GetInterface method must be used.

The list of valid interface names to pass to GetInterface is dependent upon a specific implementation. As a general rule, the name of the desired interface should match the physical name of the interface as it appears in the type library or .idl file. Check the appropriate COM class for a list of exposed dual interfaces.

Examples

The following examples in Microsoft Visual Basic Scripting Edition (VBScript) and Microsoft JScript demonstrate using the GetInterface method to return other interfaces on a MailboxStoreDB CoClass object.

The following example is in VBScript.

Dim istoredb as IMailboxStoreDB Dim idsrc as IDataSource2

'Create an instance and get IMailboxStoreDB (IDispatch) back Set istoredb = CreateObject("CDOEXM.MailboxStoreDB")

'Get IDataSource2 on the MailboxStoreDB Object Set idsrc = istoredb.GetInterface("IDataSource2")

The following example is in JScript.

var istoredb = new ActiveXObject("CDOEXM.MailboxStoreDB"); var iDsrc = istoredb.GetInterface("IDataSource2");

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.