WSReleaseUTF16ErrorMessage (C 関数)
void WSReleaseUTF16ErrorMessage(WSLINK l, const unsigned short *m, int n)
WSUTF16ErrorMessage()によって割り当てられたメモリを解放して,長さ n の配列である m にUTF-16でコード化されたメッセージを保存する.
詳細

- メッセージ m を保持するために使われたメモリは,WSUTF16ErrorMessage()への呼出しによって割り当てられたものでなければならない.
- WSReleaseUTF16ErrorMessage()は,WSTPヘッダファイルwstp.hの中で宣言される.
例題
例 (1)
#include "wstp.h"
/* A function to retrieve the error message from a link */
void f(WSLINK l)
{
const unsigned short *message;
int length;
message = WSUTF16ErrorMessage(l, &length);
/* We test for length <= 1 because WSUTF16Error message
returns a string that begins with a byte order mark */
if(message == (const unsigned short *)0 || length <= 1)
{ /* Unable to retrieve the error message from the link */ }
/* ... */
WSReleaseUTF16ErrorMessage(l, message, length);
}