Platform SDK: Exchange Server |
The HrCnvQueryCapability function returns an HResult indicating whether the translation DLL’s HrCnvConvert function can handle a particular message. The function receives a pointer to the message to be translated, a pointer to the message class of the message, and a pointer to the environment of the translation. The function returns a BOOL indicating whether it can or cannot translate the message.
For outgoing messages, the important factor is usually the message class of the outgoing message. For incoming messages, this function may need to analyze some or all of the input message’s header or other delivery information to determine whether the message can be translated by the DLL’s HrCnvConvert function.
The environment of the translation is a string of the form GatewayName.PhaseName, such as “fax.phase2”. This allows for gateways whose requirements demand that translation take place in more than one phase. Most gateways will only need one phase and will thus have a constant string for their environment. If your gateway requires multiple phases to translate some particular message class, you must provide separate translation DLLs for each combination of message class and translation phase; consequently, HrCnvQueryCapability should return FALSE if the DLL’s environment or the message class does not match the input message or environment.
The IPM_IN and IPM_OUT sample translation DLLs, located in the \SAMPLES\DbMsg\EXCHANGE directory, contain examples of HrCnvQueryCapability functions both for incoming RFC-822 messages, and for outgoing MAPI messages.