OpenersNotesSection(Spacer1)Details

MLUCS2ErrorMessage() allocates memory that must be released by calling (NonWLLink[MLReleaseUCS2ErrorMessage(), paclet:/ref/c/MLReleaseUCS2ErrorMessage]).

MLUCS2ErrorMessage() 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 the error message from a link */

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

	message = MLUCS2ErrorMessage(l, &length);
	if(message == (const unsigned short *)0 || length == 0)
	{ /* Unable to get the error message from the link */ }

	/* ... */

	MLReleaseUCS2ErrorMessage(l, message, length);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[MLReleaseUCS2ErrorMessage(), paclet:/ref/c/MLReleaseUCS2ErrorMessage])  ▪  (NonWLLink[MLErrorMessage(), paclet:/ref/c/MLErrorMessage])  ▪  (NonWLLink[MLUTF16ErrorMessage(), paclet:/ref/c/MLUTF16ErrorMessage])  ▪  (NonWLLink[MLUTF32ErrorMessage(), paclet:/ref/c/MLUTF32ErrorMessage])  ▪  (NonWLLink[MLUTF8ErrorMessage(), paclet:/ref/c/MLUTF8ErrorMessage])  ▪  (NonWLLink[MLError(), paclet:/ref/c/MLError])  ▪  (NonWLLink[MLClearError(), paclet:/ref/c/MLClearError])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Error and Interrupt Handling, paclet:tutorial/ErrorAndInterruptHandling])}})}})