MLUTF8ErrorMessage (C 函数)
MLUTF8ErrorMessage 已经被 WSUTF8ErrorMessage 所取代.
const unsigned char * MLUTF8ErrorMessage(MLINK l, int *n)
returns a string of length n encoded in the UTF-8 character encoding form describing the last error to occur on the MathLink connection specified by l.
更多信息
- MLUTF8ErrorMessage() allocates memory for the message string that must be released. Use MLReleaseUTF8ErrorMessage() to release the memory allocated by MLUTF8ErrorMessage(). If MLUTF8ErrorMessage() returns NULL, do not call MLReleaseUTF8ErrorMessage() on the NULL value.
- Programs should not modify the contents of the string.
- MLUTF8ErrorMessage() is declared in the MathLink header file mathlink.h.
范例
基本范例 (1)
#include "mathlink.h"
/* A function for reading the error message of a link */
void f(MLINK l)
{
const unsigned char *message;
int length;
message = MLUTF8ErrorMessage(l, &length);
if(message == (const unsigned char *)0 || length == 0)
{ /* Unable to read the error message from the link */ }
/* ... */
MLReleaseUTF8ErrorMessage(l, message, length);
}