OpenersNotesSection(Spacer1)Details

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

MLReleaseUTF32ErrorMessage() 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 for reading an error message from a link */

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

	message = MLUTF32ErrorMessage(l, &length);

	/* We check for length <= 1 here because MLUTF32ErrorMessage
	returns a string with a byte order mark. */

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

	/* ... */

	MLReleaseUTF32ErrorMessage(l, message, length);
}

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