1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../../../css/manpage.css" type="text/css" />
7    <style type="text/css"><!--
8      span.static_style
9      {
10        font-size			: 8pt;
11        color				: white;
12        font-weight			: bold;
13        background			: #44f;
14        border-left			: solid 1px #aaf;
15        border-top			: solid 1px #aaf;
16        border-right		: solid 1px #00c;
17        border-bottom		: solid 1px #00c;
18        padding-left		: 2px;
19        padding-right		: 2px;
20      }
21
22      span.virtual_style
23      {
24        font-size			 : 8pt;
25        color				 : white;
26        font-weight			: bold;
27        background			: #0a0;
28        border-left			: solid 1px #0f0;
29        border-top			: solid 1px #0f0;
30        border-right		: solid 1px #060;
31        border-bottom		: solid 1px #060;
32        padding-left		: 2px;
33        padding-right		: 2px;
34      }
35
36      span.protected_style
37      {
38        font-size			 : 8pt;
39        color				 : white;
40        font-weight			: bold;
41        background			: #444;
42        border-left			: solid 1px #ccc;
43        border-top			: solid 1px #ccc;
44        border-right		: solid 1px #222;
45        border-bottom		: solid 1px #222;
46        padding-left		: 2px;
47        padding-right		: 2px;
48      }
49        --></style>
50    <title>nn::cec::CTR::MessageBox</title>
51  </head>
52  <body>
53    <h1><CODE>nn::cec::CTR::MessageBox</CODE> Class</h1>
54    <h2>Syntax</h2>
55    <div class="section">
56      <pre class="definition">class MessageBox</pre>
57    </div>
58    <h2>Description</h2>
59    <div class="section">
60      <p>Class for accessing StreetPass <a href="../../../../nn/cec/CTR/MessageBox/Overview.html"><CODE>MessageBox</CODE></a> objects.</p><p>This allows you to create and delete boxes, write and load messages, get box information, and so forth. By creating a box with the <a href="../../../../nn/cec/CTR/MessageBox/CreateMessageBox.html"><CODE>CreateMessageBox</CODE></a> function and then opening it with the <a href="../../../../nn/cec/CTR/MessageBox/OpenMessageBox.html"><CODE>OpenMessageBox</CODE></a> function, you can access the messages in that box. You can use the <a href="../../../../nn/cec/CTR/MessageBox/WriteMessage.html"><CODE>WriteMessage</CODE></a> function to write messages to a box. Messages written to the outbox are sent. Received messages are stored in the inbox and can be read with the <a href="../../../../nn/cec/CTR/MessageBox/ReadMessage.html"><CODE>ReadMessage</CODE></a> function.<br /> Call the <CODE>CloseMessageBox</CODE> function when you have finished accessing the box.<br /><br /> When a message is created and written, a <a href="../../../../nn/cec/CTR/MessageId/Overview.html"><CODE>MessageId</CODE></a> is given to the message. The <CODE>MessageId</CODE> is a randomly generated unique value, and each message is accessed using this value as the key.<br /><br /> Use the <CODE>GetMessageXXX</CODE> functions to get various information, such as the attributes of individual messages. Because the <CODE>GetMessageXXX</CODE> functions retrieve information from the message list stored in the system, they can get information faster than the message itself can be accessed with <CODE>ReadMessage</CODE>. This information is read from the system when the <CODE>OpenMessageBox</CODE> function is called. It is possible that the message list stored in the system and the information in the messages themselves may become unsynchronized due to an unexpected power outage or other interruption. (For example, you may be able to get the message ID but <CODE>ReadMessage</CODE> may fail.) The message list is regenerated when a message is written with <CODE>WriteMessage</CODE>, but if processing enters an irrecoverable state, delete it using <CODE>DeleteAllMessages</CODE> and then <CODE>DeleteMessageBox</CODE>.<br /><br /> The EULA version to which the user has agreed is checked when a message is written by the <a href="../../../../nn/cec/CTR/MessageBox/WriteMessage.html"><CODE>WriteMessage</CODE></a> function. You must initialize the FS library before calling this function because the check uses <a href="../../../../nn/fs/Overview.html">FS</a> library features.</p><!-- write here --></div>
61    <a name="function" id="function">
62      <h2>Member Functions</h2>
63      <div class="section">
64        <table class="members">
65          <tr>
66            <th class="category" colspan="3">Create/Delete a Message Box</th>
67          </tr>
68          <tr>
69            <td width="100">  </td>
70            <th>
71              <a href="../../../../nn/cec/CTR/MessageBox/CreateMessageBox.html"><CODE>CreateMessageBox</CODE></a>
72            </th>
73            <td>Creates a <CODE>MessageBox</CODE>. An inbox and outbox are created within the message box. Any <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a> set in the outbox is automatically sent during StreetPass communication, and any received data is stored in the inbox.</td>
74          </tr>
75          <tr>
76            <td width="100">  </td>
77            <th>
78              <a href="../../../../nn/cec/CTR/MessageBox/DeleteMessageBox.html"><CODE>DeleteMessageBox</CODE></a>
79            </th>
80            <td>Deletes a <CODE><a href="../../../../nn/cec/CTR/MessageBox/Overview.html">MessageBox</a></CODE>.</td>
81          </tr>
82          <tr>
83            <td width="100">  </td>
84            <th>
85              <a href="../../../../nn/cec/CTR/MessageBox/OpenMessageBox.html"><CODE>OpenMessageBox</CODE></a>
86            </th>
87            <td>Opens a <CODE><a href="../../../../nn/cec/CTR/MessageBox/Overview.html">MessageBox</a></CODE>. You must use this function to open a box before you can access the messages within it.</td>
88          </tr>
89          <tr>
90            <td width="100">  </td>
91            <th>
92              <a href="../../../../nn/cec/CTR/MessageBox/CloseMessageBox.html"><CODE>CloseMessageBox</CODE></a>
93            </th>
94            <td>Closes the <CODE><a href="../../../../nn/cec/CTR/MessageBox/Overview.html">MessageBox</a></CODE>. The messages are not accessible thereafter.</td>
95          </tr>
96          <tr>
97            <td width="100">  </td>
98            <th>
99              <a href="../../../../nn/cec/CTR/MessageBox/IsOpened.html"><CODE>IsOpened</CODE></a>
100            </th>
101            <td>Gets whether a <a href="../../../../nn/cec/CTR/MessageBox/Overview.html"><CODE>MessageBox</CODE></a> is already opened.</td>
102          </tr>
103          <tr>
104            <th class="category" colspan="3">Message Operations</th>
105          </tr>
106          <tr>
107            <td width="100">  </td>
108            <th>
109              <a href="../../../../nn/cec/CTR/MessageBox/ReadMessage.html"><CODE>ReadMessage</CODE></a>
110            </th>
111            <td>Reads a <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a>.</td>
112          </tr>
113          <tr>
114            <td width="100">  </td>
115            <th>
116              <a href="../../../../nn/cec/CTR/MessageBox/WriteMessage.html"><CODE>WriteMessage</CODE></a>
117            </th>
118            <td>Writes a <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a> to the system save region.</td>
119          </tr>
120          <tr>
121            <td width="100">  </td>
122            <th>
123              <a href="../../../../nn/cec/CTR/MessageBox/DeleteMessage.html"><CODE>DeleteMessage</CODE></a>
124            </th>
125            <td>Deletes a <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a>.</td>
126          </tr>
127          <tr>
128            <td width="100">  </td>
129            <th>
130              <a href="../../../../nn/cec/CTR/MessageBox/DeleteAllMessages.html"><CODE>DeleteAllMessages</CODE></a>
131            </th>
132            <td>Deletes all messages in the box.</td>
133          </tr>
134          <tr>
135            <td width="100">  </td>
136            <th>
137              <a href="../../../../nn/cec/CTR/MessageBox/CommitMessageBox.html"><CODE>CommitMessageBox</CODE></a>
138            </th>
139            <td>Commits the data written in the system save region.</td>
140          </tr>
141          <tr>
142            <th class="category" colspan="3">Controlling Boxes and Getting Information</th>
143          </tr>
144          <tr>
145            <td width="100">  </td>
146            <th>
147              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageBoxData.html"><CODE>GetMessageBoxData</CODE></a>
148            </th>
149            <td>Gets the data associated with a <CODE><a href="../../../../nn/cec/CTR/MessageBox/Overview.html">MessageBox</a></CODE>.</td>
150          </tr>
151          <tr>
152            <td width="100">  </td>
153            <th>
154              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageBoxDataSize.html"><CODE>GetMessageBoxDataSize</CODE></a>
155            </th>
156            <td>Gets the data size associated with a <CODE><a href="../../../../nn/cec/CTR/MessageBox/Overview.html">MessageBox</a></CODE>.</td>
157          </tr>
158          <tr>
159            <td width="100">  </td>
160            <th>
161              <a href="../../../../nn/cec/CTR/MessageBox/SetMessageBoxData.html"><CODE>SetMessageBoxData</CODE></a>
162            </th>
163            <td>Sets the data associated with a <CODE><a href="../../../../nn/cec/CTR/MessageBox/Overview.html">MessageBox</a></CODE>.</td>
164          </tr>
165          <tr>
166            <td width="100">  </td>
167            <th>
168              <a href="../../../../nn/cec/CTR/MessageBox/SetMessageBoxName.html"><CODE>SetMessageBoxName</CODE></a>
169            </th>
170            <td>Sets a <CODE><a href="../../../../nn/cec/CTR/MessageBox/Overview.html">MessageBox</a></CODE>'s name.</td>
171          </tr>
172          <tr>
173            <td width="100">  </td>
174            <th>
175              <a href="../../../../nn/cec/CTR/MessageBox/SetMessageBoxIcon.html"><CODE>SetMessageBoxIcon</CODE></a>
176            </th>
177            <td>Sets a <CODE><a href="../../../../nn/cec/CTR/MessageBox/Overview.html">MessageBox</a></CODE>'s icon.</td>
178          </tr>
179          <tr>
180            <td width="100">  </td>
181            <th>
182              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageBoxName.html"><CODE>GetMessageBoxName</CODE></a>
183            </th>
184            <td>Gets a <CODE><a href="../../../../nn/cec/CTR/MessageBox/Overview.html">MessageBox</a></CODE>'s name.</td>
185          </tr>
186          <tr>
187            <td width="100">  </td>
188            <th>
189              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageBoxIcon.html"><CODE>GetMessageBoxIcon</CODE></a>
190            </th>
191            <td>Gets a <CODE><a href="../../../../nn/cec/CTR/MessageBox/Overview.html">MessageBox</a></CODE>'s icon.</td>
192          </tr>
193          <tr>
194            <th class="category" colspan="3">Getting Message Box Information</th>
195          </tr>
196          <tr>
197            <td width="100">  </td>
198            <th>
199              <a href="../../../../nn/cec/CTR/MessageBox/GetBoxFlag.html"><CODE>GetBoxFlag</CODE></a>
200            </th>
201            <td>Gets the attributes of a <CODE><a href="../../../../nn/cec/CTR/MessageBox/Overview.html">MessageBox</a></CODE>.</td>
202          </tr>
203          <tr>
204            <td width="100">  </td>
205            <th>
206              <a href="../../../../nn/cec/CTR/MessageBox/GetBoxSizeMax.html"><CODE>GetBoxSizeMax</CODE></a>
207            </th>
208            <td>Gets the capacity of the inbox or outbox.</td>
209          </tr>
210          <tr>
211            <td width="100">  </td>
212            <th>
213              <a href="../../../../nn/cec/CTR/MessageBox/GetBoxSize.html"><CODE>GetBoxSize</CODE></a>
214            </th>
215            <td>Gets the used capacity of the inbox or outbox.</td>
216          </tr>
217          <tr>
218            <td width="100">  </td>
219            <th>
220              <a href="../../../../nn/cec/CTR/MessageBox/GetBoxMessNumMax.html"><CODE>GetBoxMessNumMax</CODE></a>
221            </th>
222            <td>Gets the maximum number of <a href="../../../../nn/cec/CTR/Message/Overview.html">messages</a> in the inbox or outbox.</td>
223          </tr>
224          <tr>
225            <td width="100">  </td>
226            <th>
227              <a href="../../../../nn/cec/CTR/MessageBox/GetBoxMessNum.html"><CODE>GetBoxMessNum</CODE></a>
228            </th>
229            <td>Gets the number of <a href="../../../../nn/cec/CTR/Message/Overview.html">messages</a> in the inbox or outbox.</td>
230          </tr>
231          <tr>
232            <td width="100">  </td>
233            <th>
234              <a href="../../../../nn/cec/CTR/MessageBox/GetBoxGroupNumMax.html"><CODE>GetBoxGroupNumMax</CODE></a>
235            </th>
236            <td>Gets the maximum number of <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a> groups in the inbox or outbox.</td>
237          </tr>
238          <tr>
239            <td width="100">  </td>
240            <th>
241              <a href="../../../../nn/cec/CTR/MessageBox/GetBoxGroupNum.html"><CODE>GetBoxGroupNum</CODE></a>
242            </th>
243            <td>Gets the number of <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a> groups in the inbox or outbox.</td>
244          </tr>
245          <tr>
246            <td width="100">  </td>
247            <th>
248              <a href="../../../../nn/cec/CTR/MessageBox/SetBoxGroupNumMax.html"><CODE>SetBoxGroupNumMax</CODE></a>
249            </th>
250            <td>Sets the maximum number of <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a> groups in the inbox or outbox.</td>
251          </tr>
252          <tr>
253            <td width="100">  </td>
254            <th>
255              <a href="../../../../nn/cec/CTR/MessageBox/GetBoxSessionNum.html"><CODE>GetBoxSessionNum</CODE></a>
256            </th>
257            <td>Gets the Session ID count for (the number of items received in) the inbox.</td>
258          </tr>
259          <tr>
260            <th class="category" colspan="3">Getting Message Information (old API)</th>
261          </tr>
262          <tr>
263            <td width="100">  </td>
264            <th>
265              <a href="../../../../nn/cec/CTR/MessageBox/GetInBoxMessIdByIndex.html"><CODE>GetInBoxMessIdByIndex</CODE></a>
266            </th>
267            <td>Gets the <CODE>MessageID</CODE> of the <CODE>n</CODE><SUP>th</SUP> <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a> in the inbox.</td>
268          </tr>
269          <tr>
270            <td width="100">  </td>
271            <th>
272              <a href="../../../../nn/cec/CTR/MessageBox/GetOutBoxMessIdByIndex.html"><CODE>GetOutBoxMessIdByIndex</CODE></a>
273            </th>
274            <td>Gets the  <CODE>MessageID</CODE> of the <CODE>n</CODE><SUP>th</SUP> <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a> in the outbox.</td>
275          </tr>
276          <tr>
277            <td width="100">  </td>
278            <th>
279              <a href="../../../../nn/cec/CTR/MessageBox/GetMessSizeByMessId.html"><CODE>GetMessSizeByMessId</CODE></a>
280            </th>
281            <td>Gets the size of the <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a> with the specified <CODE>MessageID</CODE>.</td>
282          </tr>
283          <tr>
284            <th class="category" colspan="3">Getting Message Information</th>
285          </tr>
286          <tr>
287            <td width="100">  </td>
288            <th>
289              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageMessSize.html"><CODE>GetMessageMessSize</CODE></a>
290            </th>
291            <td>Gets the size of a message.</td>
292          </tr>
293          <tr>
294            <td width="100">  </td>
295            <th>
296              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageBodySize.html"><CODE>GetMessageBodySize</CODE></a>
297            </th>
298            <td>Gets the size of a message's body.</td>
299          </tr>
300          <tr>
301            <td width="100">  </td>
302            <th>
303              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageGroupId.html"><CODE>GetMessageGroupId</CODE></a>
304            </th>
305            <td>Gets the group ID of a message.</td>
306          </tr>
307          <tr>
308            <td width="100">  </td>
309            <th>
310              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageSessionId.html"><CODE>GetMessageSessionId</CODE></a>
311            </th>
312            <td>Gets an inbox message's session ID. (The ID assigned when received.)</td>
313          </tr>
314          <tr>
315            <td width="100">  </td>
316            <th>
317              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageMessTypeFlag.html"><CODE>GetMessageMessTypeFlag</CODE></a>
318            </th>
319            <td>Gets the <CODE>CecMessageTypeFlag</CODE> of a message.</td>
320          </tr>
321          <tr>
322            <td width="100">  </td>
323            <th>
324              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageSendMode.html"><CODE>GetMessageSendMode</CODE></a>
325            </th>
326            <td>Gets the <CODE><a href="../../../../nn/cec/CTR/SendMode.html">SendMode</a></CODE> of a message.</td>
327          </tr>
328          <tr>
329            <td width="100">  </td>
330            <th>
331              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageSendCount.html"><CODE>GetMessageSendCount</CODE></a>
332            </th>
333            <td>Gets the send count of a message.</td>
334          </tr>
335          <tr>
336            <td width="100">  </td>
337            <th>
338              <a href="../../../../nn/cec/CTR/MessageBox/GetMessagePropagationCount.html"><CODE>GetMessagePropagationCount</CODE></a>
339            </th>
340            <td>Gets the propagation count of a message.</td>
341          </tr>
342          <tr>
343            <td width="100">  </td>
344            <th>
345              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageTag.html"><CODE>GetMessageTag</CODE></a>
346            </th>
347            <td>Gets the message tag of a message.</td>
348          </tr>
349          <tr>
350            <td width="100">  </td>
351            <th>
352              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageSendDate.html"><CODE>GetMessageSendDate</CODE></a>
353            </th>
354            <td>Gets the timestamp of when a received message was sent.</td>
355          </tr>
356          <tr>
357            <td width="100">  </td>
358            <th>
359              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageRecvDate.html"><CODE>GetMessageRecvDate</CODE></a>
360            </th>
361            <td>Gets the timestamp of when a message was received.</td>
362          </tr>
363          <tr>
364            <td width="100">  </td>
365            <th>
366              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageCreateDate.html"><CODE>GetMessageCreateDate</CODE></a>
367            </th>
368            <td>Gets the timestamp of when a message was created.</td>
369          </tr>
370          <tr>
371            <td width="100">  </td>
372            <th>
373              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageMessIdPair.html"><CODE>GetMessageMessIdPair</CODE></a>
374            </th>
375            <td>Gets the pair of <CODE>MessageID</CODE>s corresponding to a <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a> exchange.</td>
376          </tr>
377          <tr>
378            <td width="100">  </td>
379            <th>
380              <a href="../../../../nn/cec/CTR/MessageBox/GetMessageMessId.html"><CODE>GetMessageMessId</CODE></a>
381            </th>
382            <td>Gets the <CODE>MessageID</CODE> of a message.</td>
383          </tr>
384          <tr>
385            <td width="100">  </td>
386            <th>
387              <a href="../../../../nn/cec/CTR/MessageBox/GetMessIndex.html"><CODE>GetMessIndex</CODE></a>
388            </th>
389            <td>Gets a message's index (<CODE>messIndex</CODE>) based on its <CODE>MessageID</CODE>.</td>
390          </tr>
391          <tr>
392            <th class="category" colspan="3">Other</th>
393          </tr>
394          <tr>
395            <td width="100">  </td>
396            <th>
397              <a href="../../../../nn/cec/CTR/MessageBox/SetBoxActivate.html"><CODE>SetBoxActivate</CODE></a>
398            </th>
399            <td>Specifies whether a <CODE><a href="../../../../nn/cec/CTR/MessageBox/Overview.html">MessageBox</a></CODE> is enabled or disabled. A disabled box will not have any data sent or received.</td>
400          </tr>
401          <tr>
402            <td width="100">  </td>
403            <th>
404              <a href="../../../../nn/cec/CTR/MessageBox/GetBoxActivate.html"><CODE>GetBoxActivate</CODE></a>
405            </th>
406            <td>Gets whether a <CODE><a href="../../../../nn/cec/CTR/MessageBox/Overview.html">MessageBox</a></CODE> is enabled or disabled. A disabled box will not have any data sent or received.</td>
407          </tr>
408          <tr>
409            <td width="100">  </td>
410            <th>
411              <a href="../../../../nn/cec/CTR/MessageBox/RoundOutBoxIndex.html"><CODE>RoundOutBoxIndex</CODE></a>
412            </th>
413            <td>Moves the <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a> with the specified <CODE>MessageID</CODE> to the end of the outbox's outgoing message queue. ( The queue order is automatically changed when a <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a> is sent, so there is normally no need to call this function.)</td>
414          </tr> </table>
415      </div>
416    </a>
417    <h2>Revision History</h2>
418    <div class="section">
419      <dl class="history">
420        <dt>2010/08/16</dt>
421        <dd>Initial version.<br />
422        </dd>
423      </dl>
424    </div>
425  <hr><p>CONFIDENTIAL</p></body>
426</html>