OpenersNotesSection(Spacer1)Details

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

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

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

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

	/* ... */

	WSReleaseUTF8ErrorMessage(l, message, length);
}

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

({{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])}})}})