OPTIONCALLBACK

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Defines a callback function that MAPI calls to retrieve a wrapped IMAPIProp interface that manages a transport provider's properties.

Header file:

Mapispi.h

Defined function implemented by:

Transport providers

Defined function called by:

MAPI

SCODE OPTIONCALLBACK(
  HINSTANCE hInst,
  LPMALLOC lpMalloc,
  ULONG ulFlags,
  ULONG cbOptionData,
  LPBYTE lpbOptionData,
  LPMAPISUP lpMAPISup,
  LPMAPIPROP lpDataSource,
  LPMAPIPROP FAR * lppWrappedSource,
  LPMAPIERROR FAR * lppMAPIError
);

Parameters

  • hInst
    [in] The hinstance value for this transport provider's dynamic-link library (DLL) as returned from the LoadLibrary function call made by MAPI.

  • lpMalloc
    [in] Pointer to a memory allocator object exposing the OLE IMalloc interface. The transport provider may need to use this allocation method when working with certain interfaces such as IStream.

  • ulFlags
    [in] Bitmask of flags that controls what options are processed. The following flags can be set:

    • OPTION_TYPE_MESSAGE
      Message options.

    • OPTION_TYPE_RECIPIENT
      Recipient options.

  • cbOptionData
    [in] Size, in bytes, of the data pointed to by the lpbOptionData parameter.

  • lpbOptionData
    [in] Pointer to an OPTIONDATA structure that contains option data for the recipient or message. This OPTIONDATA structure was passed in the call to the IXPLogon::RegisterOptions method that registered the options.

  • lpMAPISup
    [in] Pointer to a MAPI support object the provider can use to call the methods of the IMAPISupport : IUnknown interface.

  • lpDataSource
    [in] Pointer to an IMAPIProp : IUnknown interface that MAPI wraps for the transport provider's use.

  • lppWrappedSource
    [out] Pointer to a pointer to the wrapped IMAPIProp interface returned by the transport provider.

  • lppMAPIError
    [out] Pointer to a pointer to the returned MAPIERROR structure, if any, that contains version, component, and context information for the error.

Return Value

  • S_OK
    The call succeeded and has returned the expected value or values.

Remarks

MAPI calls the transport provider's OPTIONCALLBACK function if a transport provider has previously registered message options with the IXPLogon::RegisterOptions method. Transport providers that do not define message or recipient options do not need to implement this callback function.

MAPI passes a wrapped IMAPIProp : IUnknown interface in the lpDataSource parameter. The transport provider should build a display table, set any properties, and then pass that display table back to MAPI in a wrapped IMAPIProp interface in the lppWrappedSource parameter. MAPI uses this IMAPIProp interface to display properties in the message or recipient options dialog box that is displayed to users. When users make selections in the dialog box resulting in a call to the IMAPIProp::OpenProperty method for the PR_DETAILS_TABLE (PidTagDetailsTable) property, the transport provider gets the call and should display the display table. The transport provider must call the IMAPIProp::SetProps method followed by the IMAPIProp::SaveChanges method on any changes the user made to the display table.

For more information about how to create display tables, see Display Tables.