4.5 Sending a Message with Voting Options
In this example, a user wants to send a message that has "Yes", "No", and "Maybe" voting options. To do so, the client constructs the message to contain a PidLidVerbStream property (section 2.2.1.74).
The complete contents of the PidLidVerbStream property in this example are shown in the following stream. The other properties of the message are not specific to voting and are omitted.
-
0000: 02 01 03 00 00 00 04 00-00 00 03 59 65 73 08 49 0010: 50 4D 2E 4E 6F 74 65 00-03 59 65 73 00 00 00 00 0020: 00 00 00 00 00 01 00 00-00 02 00 00 00 02 00 00 0030: 00 01 00 00 00 FF FF FF-FF 04 00 00 00 02 4E 6F 0040: 08 49 50 4D 2E 4E 6F 74-65 00 02 4E 6F 00 00 00 0050: 00 00 00 00 00 00 01 00-00 00 02 00 00 00 02 00 0060: 00 00 02 00 00 00 FF FF-FF FF 04 00 00 00 05 4D 0070: 61 79 62 65 08 49 50 4D-2E 4E 6F 74 65 00 05 4D 0080: 61 79 62 65 00 00 00 00-00 00 00 00 00 01 00 00 0090: 00 02 00 00 00 02 00 00-00 03 00 00 00 FF FF FF 00A0: FF 04 01 03 59 00 65 00-73 00 03 59 00 65 00 73 00B0: 00 02 4E 00 6F 00 02 4E-00 6F 00 05 4D 00 61 00 00C0: 79 00 62 00 65 00 05 4D-00 61 00 79 00 62 00 65 00D0: 00
The first six bytes contain the Version and Count fields specified in section 2.2.1.74.
-
0000: 02 01 03 00 00 00
Version: 0x0102
Count: 0x00000003
This indicates that the structure contains three VoteOption structures. The first VoteOption structure begins at byte 0x0006.
-
0006: 04 00 00 00 03 59 65 73-08 49 50 4D 2E 4E 6F 74 0016: 65 00 03 59 65 73 00 00-00 00 00 00 00 00 00 01 0026: 00 00 00 02 00 00 00 02-00 00 00 01 00 00 00 FF 0036: FF FF FF
VerbType: 0x00000004
DisplayNameCount: 0x03
DisplayName: ANSI string (not null-terminated): "Yes"
MsgClsNameCount: 0x08
MsgClsName: ANSI string (not null-terminated): "IPM.Note"
Internal1StringCount: 0x00
DisplayNameCountRepeat: 0x03
DisplayNameRepeat: ANSI string (not null-terminated): "Yes"
Internal2: 0x00000000
Internal3: 0x00
fUseUSHeaders: False (0x00000000)
Internal4: 0x00000001
SendBehavior: 0x00000002 (prompt before sending)
Internal5: 0x00000002
ID: 0x00000001
Internal6: 0xFFFFFFFF
The second and third VoteOption structures (for "No" and "Maybe") begin at bytes 0x0039 and 0x006A respectively. The third VoteOption structure concludes at byte 0x00A0, and byte 0x00A1 begins the Version2 field.
-
00A1: 04 01
Version2: 0x0104
This is followed by three VoteOptionExtras structures — a parallel array that contains additional information about the three VoteOption structures seen earlier. The first begins at byte 0x00A3.
-
00A3: 03 59 00 65 00 73 00 03-59 00 65 00 73 00
DisplayNameCount: 0x03
DisplayName: Unicode string (not null-terminated): "Yes"
DisplayNameCountRepeat: 0x03
DisplayNameRepeat: Unicode String (not null-terminated): "Yes"
The second and third VoteOptionExtras structures (for "No" and "Maybe") begin at bytes 0x00B1 and 0x00BB, respectively, and constitute the remainder of the buffer.