1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META http-equiv="Content-Style-Type" content="text/css">
6<TITLE>NWC24SetMsgSubjectAndTextPublic</TITLE>
7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
8</HEAD>
9<BODY>
10<H1>NWC24SetMsgSubjectAndTextPublic</H1>
11
12<H2>C Specification</H2>
13<DL>
14  <DD><PRE><CODE>#include &lt;revolution/nwc24.h&gt;</CODE></PRE>
15  <DD><PRE><CODE><A HREF="../Types/NWC24Err.html">NWC24Err</A> NWC24SetMsgSubjectAndTextPublic(
16    <A HREF="../Types/NWC24MsgObj.html">NWC24MsgObj</A>*       <EM>obj</EM>,
17    const u16*         <EM>subject</EM>,
18    u32                <EM>subjLen</EM>,
19    const u16*         <EM>text</EM>,
20    u32                <EM>textLen</EM>,
21    <A HREF="../Types/NWC24AutoEncodingType.html">NWC24AutoEncodingType</A> <EM>autoEnc</EM>,
22    u16                <EM>altChar</EM>,
23    u8*                <EM>work</EM>,
24    u32                <EM>workSize</EM>
25);</CODE></PRE>
26</DL>
27
28<H2>Description</H2>
29<P>
30Specifies the public message subject and body text with strings. Conversion to external formats such as text encoding occurs automatically.
31</P>
32<P>
33The internal character encoding is specified in the UTF-16BE strings <CODE><EM><STRONG>subject</STRONG></EM></CODE> and <CODE><EM><STRONG>text</STRONG></EM></CODE>, and their string lengths are specified in <CODE><EM><STRONG>subjLen</STRONG></EM></CODE> and <CODE><EM><STRONG>textLen</STRONG></EM></CODE>.<BR>The encoding's auto-determination type, which serves as a hint when processing a public message, is passed to <CODE><EM><STRONG>autoEnc</STRONG></EM></CODE>. The external character encoding during the send from <CODE><EM><STRONG>autoEnc</STRONG></EM></CODE>, as well as the type of text appearing in <CODE><EM><STRONG>subject</STRONG></EM></CODE> and <CODE><EM><STRONG>text</STRONG></EM></CODE>, are automatically determined. <CODE><EM><STRONG>subject</STRONG></EM></CODE> and <CODE><EM><STRONG>text</STRONG></EM></CODE> are converted to the same external character encoding.<BR>In <CODE><EM><STRONG>altChar</STRONG></EM></CODE>, using UTF-16BE encoded text, specify the text to be used as an alternate when the external text encoding cannot be converted. If 0 is specified for <CODE><EM><STRONG>altChar</STRONG></EM></CODE>, the <CODE>NWC24_ERR_INVALID_CHAR</CODE> error will be returned when text that cannot be converted is encountered. Furthermore, under current specifications, <CODE><EM><STRONG>altChar</STRONG></EM></CODE> will not be used, as external text encoding that allows all text to be converted will be selected.<BR>Working memory must be passed to <CODE><EM><STRONG>work</STRONG></EM></CODE> for the conversion process. You must allocate a working memory size that is roughly twice as long as the string data expressed in external encoding for the subject and message body to be processed. <CODE>NWC24_ERR_OVERFLOW</CODE> is returned when there is insufficient working memory.
34</P>
35
36<P>
37The buffers given by the <CODE><EM><STRONG>subject</STRONG></EM></CODE>, <CODE><EM><STRONG>text</STRONG></EM></CODE> and <CODE><EM><STRONG>work</STRONG></EM></CODE> arguments must not be deallocated until <CODE><EM><STRONG>NWC24CommitMsg()</STRONG></EM></CODE> is called and the creation of the message is complete. Be particularly careful not to re-use the working memory buffer given by the <CODE><EM><STRONG>work</STRONG></EM></CODE> argument.
38</P>
39
40<H2>Arguments</H2>
41<TABLE border="1" cellpadding="3" cellspacing="0.1">
42  <TR>
43<TD width="120" bgcolor="#ffffe8"><code><em><strong>obj</strong></em></code></TD>
44    <TD width="520">
45Pointer to the message object to be set.
46    </TD>
47  </TR>
48  <TR>
49<TD width="120" bgcolor="#ffffe8"><code><em><strong>subject</strong></em></code></TD>
50    <TD width="520">
51A pointer to the subject string expressed in UTF-16BE.
52    </TD>
53  </TR>
54  <TR>
55<TD width="120" bgcolor="#ffffe8"><code><em><strong>subjLen</strong></em></code></TD>
56    <TD width="520">
57The number of characters in the UTF-16BE string specified in <code><em><strong>subject</strong></em></code>.
58    </TD>
59  </TR>
60  <TR>
61<TD width="120" bgcolor="#ffffe8"><code><em><strong>text</strong></em></code></TD>
62    <TD width="520">
63A pointer to the message body string expressed in UTF-16BE.
64    </TD>
65  </TR>
66  <TR>
67<TD width="120" bgcolor="#ffffe8"><code><em><strong>textLen</strong></em></code></TD>
68    <TD width="520">
69The number of characters in the UTF-16BE string specified in <code><em><strong>text</strong></em></code>.
70    </TD>
71  </TR>
72  <TR>
73<TD width="120" bgcolor="#ffffe8"><code><em><strong>autoEnc</strong></em></code></TD>
74    <TD width="520">
75An auto-determining type of <A HREF="../Types/NWC24AutoEncodingType.html">NWC24AutoEncodingType</A> type, used as a hint during conversion.<BR>
76    </TD>
77  </TR>
78  <TR>
79<TD width="120" bgcolor="#ffffe8"><code><em><strong>altChar</strong></em></code></TD>
80    <TD width="520">
81Alternate text, in UTF-16BE encoding, to be used when text that cannot be converted to external text encoding is encountered.<BR>
82    </TD>
83  </TR>
84  <TR>
85<TD width="120" bgcolor="#ffffe8"><code><em><strong>work</strong></em></code></TD>
86    <TD width="520">
87The working memory used for conversion.<BR>
88    </TD>
89  </TR>
90  <TR>
91<TD width="120" bgcolor="#ffffe8"><code><em><strong>workSize</strong></em></code></TD>
92    <TD width="520">
93The length of the work memory specified in <code><em><strong>work</strong></em></code>.<BR>
94    </TD>
95  </TR>
96</TABLE>
97
98<h2>Return Values</h2>
99<P>
100<code>NWC24_OK</code>: Normal exit.<BR> <code>NWC24_ERR_PROTECTED</code>: Message object cannot be changed.<BR> <code>NWC24_ERR_NULL</code>: Either <code><em><strong>subject</strong></em></code> is a null pointer or the subject string is empty.<BR> <code>NWC24_ERR_OVERFLOW</code>: Insufficient work memory region.<BR> <code>NWC24_ERR_STRING_END</code>: Either <code><em><strong>subject</strong></em></code> or <code><em><strong>text</strong></em></code> is not null-terminated.<BR> <code>NWC24_ERR_INVALID_VALUE</code>: Invalid argument.<BR> <code>NWC24_ERR_INVALID_CHAR</code>: Unable to convert to external character encoding.<BR>
101</P>
102
103<H2>See Also</H2>
104<P>
105<A href="NWC24InitMsgObj.html"><CODE>NWC24InitMsgObj</CODE></A>
106</P>
107
108<H2>Revision History</H2>
109<P>
1102007/02/15 Initial version.
111</P>
112
113<hr><p>CONFIDENTIAL</p></body>
114</HTML>