OpenersNotesSection(Spacer1)Details

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

WSReleaseUTF32ErrorMessage() is declared in the WSTP header file (RefLink[wstp.h, paclet:ref/file/wstp.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "wstp.h"

/* A function for reading an error message from a link */

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

	message = WSUTF32ErrorMessage(l, &length);

	/* We check for length <= 1 here because WSUTF32ErrorMessage
	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 */ }

	/* ... */

	WSReleaseUTF32ErrorMessage(l, message, length);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSUTF32ErrorMessage(), paclet:ref/c/WSUTF32ErrorMessage])  ▪  (NonWLLink[WSReleaseErrorMessage(), paclet:ref/c/WSReleaseErrorMessage])  ▪  (NonWLLink[WSReleaseUCS2ErrorMessage(), paclet:ref/c/WSReleaseUCS2ErrorMessage])  ▪  (NonWLLink[WSReleaseUTF16ErrorMessage(), paclet:ref/c/WSReleaseUTF16ErrorMessage])  ▪  (NonWLLink[WSReleaseUTF8ErrorMessage(), paclet:ref/c/WSReleaseUTF8ErrorMessage])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[WSTP C API Developer Guide (Mac OS X), paclet:tutorial/WSTPDeveloperGuide-MacintoshOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Unix and Linux), paclet:tutorial/WSTPDeveloperGuide-UnixOverview])}, {▪(RefLinkPlain[WSTP C API Developer Guide (Windows), paclet:tutorial/WSTPDeveloperGuide-WindowsOverview])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Alphabetical Listing of WSTP C Functions, paclet:guide/AlphabeticalListingOfWSTPCFunctions])}, {▪(RefLinkPlain[WSTP C Language Functions, paclet:guide/WSTPCLanguageFunctions])}})}})