OpenersNotesSection(Spacer1)Details

The memory used to contain the message m must have been allocated by a call to (NonWLLink[MLUTF16ErrorMessage(), paclet:/ref/c/MLUTF16ErrorMessage]).

MLReleaseUTF16ErrorMessage() is declared in the MathLink header file (RefLink[mathlink.h, paclet:/ref/file/mathlink.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "mathlink.h"

/* A function to retrieve the error message from a link */

void f(MLINK l)
{
	const unsigned short *message;
	int length;

	message = MLUTF16ErrorMessage(l, &length);

	/* We test for length <= 1 because MLUTF16Error message
	returns a string that begins with a byte order mark */

	if(message == (const unsigned short *)0 || length <= 1)
	{ /* Unable to retrieve the error message from the link */ }

	/* ... */

	MLReleaseUTF16ErrorMessage(l, message, length);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[MLUTF16ErrorMessage(), paclet:/ref/c/MLUTF16ErrorMessage])  ▪  (NonWLLink[MLReleaseErrorMessage(), paclet:/ref/c/MLReleaseErrorMessage])  ▪  (NonWLLink[MLReleaseUCS2ErrorMessage(), paclet:/ref/c/MLReleaseUCS2ErrorMessage])  ▪  (NonWLLink[MLReleaseUTF32ErrorMessage(), paclet:/ref/c/MLReleaseUTF32ErrorMessage])  ▪  (NonWLLink[MLReleaseUTF8ErrorMessage(), paclet:/ref/c/MLReleaseUTF8ErrorMessage])}})}})