IMAPISupport::RegisterPreprocessor

Applies to: Outlook 2013 | Outlook 2016

Registers a transport provider's preprocessor function (a function that conforms to the PreprocessMessage prototype).

HRESULT RegisterPreprocessor(
LPMAPIUID lpMuid,
LPSTR lpszAdrType,
LPSTR lpszDLLName,
LPSTR lpszPreprocess,
LPSTR lpszRemovePreprocessInfo,
ULONG ulFlags
);

Parameters

lpMuid

[in] A pointer to the MAPIUID structure that contains the identifier that the preprocessor function handles. The lpMuid parameter can be NULL.

lpszAdrType

[in] A pointer to the address type for the messages the function operates on, such as FAX, SMTP, or X500. The lpszAdrType parameter can be NULL.

lpszDLLName

[in] A pointer to the name of the dynamic-link library (DLL) that contains the entry point for the preprocessor function.

lpszPreprocess

[in] A pointer to the name of the preprocessor function. The lpszPreprocess parameter can be NULL.

lpszRemovePreprocessInfo

[in] A pointer to the name of the function that removes preprocessor information (a function that conforms to the RemovePreprocessInfo prototype). The lpszRemovePreprocessInfo parameter can be NULL.

ulFlags

Reserved; must be zero.

Return value

S_OK

The preprocessor function was successfully registered.

Remarks

The IMAPISupport::RegisterPreprocessor method is implemented for transport provider support objects only. Transport providers call RegisterPreprocessor to register a preprocessor function (a function that conforms to the PreprocessMessage prototype). A preprocessor function must be registered before the MAPI spooler can call it.

The lpszPreprocess, lpszRemovePreprocessInfo, and lpszDLLName parameters should all point to strings that can be used in conjunction with calls to the Win32 GetProcAddress function, allowing the preprocessor's DLL entry point to be called correctly.

Notes to callers

Calls to preprocessors are specific to transport provider order. This means that if another transport provider ahead of your provider is able to handle a message, your preprocessor function will not be called for that message. Your preprocessor function will be called only for messages that you will handle.

You can write preprocessor functions to handle either a specific identifier stored in a MAPIUID structure or a type of address. If you specify both a MAPIUID structure in the lpMuid parameter and an address type in the lpszAdrType parameter, your function will be called for message recipients that match either the MAPIUID or the address type. If lpMuid is NULL and lpszAdrType is non-NULL, your function will be called only for recipients that have an address that matches the type pointed to by lpszAdrType. If lpMuid is non-NULL and lpszAdrType is NULL, your function will be called for recipients that match MAPIUID, regardless of their address type. If both are NULL, your function is called for all recipients of the message.

See also

MAPIUID
PreprocessMessage
RemovePreprocessInfo
IMAPISupport : IUnknown