Platform SDK: Exchange 2000 Server

GetInterface Method

[This is preliminary documentation and subject to change.]

Returns the specified dual interface on the object.

[Visual Basic,VBScript]
Function GetInterface(ByVal Interface as String) as Object
[C++]
HRESULT GetInterface(BSTR Interface, IDispatch** pVal);
[IDL]
HRESULT GetInterface([in] BSTR Interface, [out,retval] IDispatch** pVal);
Interface
The name of interface to obtain. The list of possible interfaces to return depends upon the COM class that provides the implementation.
pVal [C++,IDL]
On successful return, the passed address contains the requested object reference.

Remarks

The GetInterface method is primarily intended as a generic interface navigation aid to scripting languages that do not support such navigation directly.

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. If the object does not support the requested interface, an exception is raised with the HRESULT value of E_INVALIDARG.

Example

[VBScript]
Dim iFldr 
Set iFldr = CreateObject("CDO.Folder")
' get config stored in ASP session object
Set iFldr.Configuration = Session("configobject")

' get idatasource
Dim iDsrc
Set iDsrc = iFldr.GetInterface("IDataSource")
' bind to inbox in store
' get a previously stored mailbox alias for the current user
strUserName = Session("mailboxalias")
iDSrc.Open "file:/.//backofficestorage/domain.microsoft.com/MBX/user1" & strUserName & "/Inbox/"

Response.Write("<i>you have " & iFldr.UnReadItemsCount & " unread items in your inbox</i>")
FldrName  = iFldr.DisplayName
strDescr  = iFldr.Description
' go on to display info about the folder