This function returns a string associated with an integer error number, for the last error that occurred.
At a Glance
Header file: | Smtp.h |
Windows CE versions: | 1.0 and later |
Syntax
int TransportErrorMsg(HANDLE hService, LPWSTR szBuf, int iBufLen,
int *piSrcLine,);
Parameters
hService
[in] Handle to a SERVICE structure.
szBuf
[out] Buffer to hold the error string.
iBufLen
[in] Length of szBuff, in wide characters—that is, Unicode characters; not bytes.
piSrcLine
[out] Pointer to the line where the error occurred—retrieved from the iErrLine member of the SERVICE structure.
Return Values
A string describing the nature of the error is placed in szBuf, and the line number at which the error occurred is placed in piSrcLine.
Remarks
In Windows CE version 2.0, the piSrcLine parameter can be set to –1 to inform the client that the user is aware of the problem and that it needs not to display any more messages.
In general the transport should not display error dialogs. But if the transport uses a communication service which has set up error dialogs, the transport might have to assume the responsibility to display the error information.
The transport service provider must implement the TransportErrorMsg function in a DLL registered as a mail service. The Inbox application can then load this DLL and call this function.
For example, the sample transport service returns one of the following error strings in szBuf.
Error String | String Resource Error Code |
"No error" | TRANS_ERR_NONE |
"Service directory unavailable." | TRANS_ERR_NO_SVC_DIR |
"Could not allocate memory for service handle." | TRANS_ERR_HANDLE_NOT_ALLOC |
"Could not create message file." | TRANS_ERR_CANT_OPEN |
"Could not open mail message." | TRANS_ERR_CANT_SEND |
"Invalid message identifier specified." | TRANS_ERR_INV_MSG_ID |
"Could not allocate message buffer." | TRANS_ERR_NO_MSG_BUF |
"There was an error reading the message." | TRANS_ERR_READ |
"Unknown Error" | (String table that contains error messages failed to load properly.) |
See Also