OpenersNotesSection(Spacer1)Details

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

WSReleaseUCS2ErrorMessage() 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 getting 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[WSUCS2ErrorMessage(), paclet:ref/c/WSUCS2ErrorMessage])  ▪  (NonWLLink[WSReleaseErrorMessage(), paclet:ref/c/WSReleaseErrorMessage])  ▪  (NonWLLink[WSReleaseUTF16ErrorMessage(), paclet:ref/c/WSReleaseUTF16ErrorMessage])  ▪  (NonWLLink[WSReleaseUTF32ErrorMessage(), paclet:ref/c/WSReleaseUTF32ErrorMessage])  ▪  (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])}})}})