OpenersNotesSection(Spacer1)Details

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

WSUCS2ErrorMessage() 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 short *message;
	int length;

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

	/* ... */

	WSReleaseUCS2ErrorMessage(l, message, length);
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[WSReleaseUCS2ErrorMessage(), paclet:ref/c/WSReleaseUCS2ErrorMessage])  ▪  (NonWLLink[WSErrorMessage(), paclet:ref/c/WSErrorMessage])  ▪  (NonWLLink[WSUTF16ErrorMessage(), paclet:ref/c/WSUTF16ErrorMessage])  ▪  (NonWLLink[WSUTF32ErrorMessage(), paclet:ref/c/WSUTF32ErrorMessage])  ▪  (NonWLLink[WSUTF8ErrorMessage(), paclet:ref/c/WSUTF8ErrorMessage])  ▪  (NonWLLink[WSError(), paclet:ref/c/WSError])  ▪  (NonWLLink[WSClearError(), paclet:ref/c/WSClearError])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Error and Interrupt Handling, paclet:tutorial/ErrorAndInterruptHandling])}, {▪(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[Low-Level WSTP Operations, paclet:guide/LowLevelWSTPOperations])}, {▪(RefLinkPlain[WSTP C Language Functions, paclet:guide/WSTPCLanguageFunctions])}})}})