Example Dictionary

The stock market data transfer example (see "Transferring Data Contained in Property Sets," earlier in this appendix) might include a displayable name of "Stock Quote" for the entire set, and "Ticker Symbol" for PID_SYMBOL. If a property set contained just a symbol and the dictionary, the property set section would have a byte stream that looked like the following:

Offset Bytes

; Start of section

0000 43 01 00 00 ; DWORD size of section

0004 03 00 00 00 ; DWORD number of properties in section

; Start of PropID/Offset pairs

0008 00 00 00 00 ; DWORD Property ID (0 == dictionary)

000C 20 00 00 00 ; DWORD offset to property ID

0010 01 00 00 00 ; DWORD Property ID (1 == code page)

0014 D0 00 00 00 ; DWORD offset to property ID

  1. 07 00 00 00 ; DWORD Property ID (i.e., PID_SYMBOL)

  1. C 34 01 00 00 ; DWORD offset to property ID

; Start of Property 0 (which is really the dictionary

0020 08 00 00 00 ; DWORD Number of entries in dictionary

; (Note: No type indicator)

0024 00 00 00 00 ; DWORD dwPropID = 0

  1. 18 00 00 00 ; DWORD cb = (wstrlen("Stock Quote")+1)

; * sizeof(WCHAR) == 24

002C L"Stock Quote\0" ; char sz[24]

0044 03 00 00 00 ; DWORD dwPropID = 3 (PID_SYMBOL)

0048 1C 00 00 00 ; DWORD cb = (wstrlen("Ticker Symbol") + 1

; * sizeof(WCHAR) == 28

004C L"Ticker Symbol\0" ; char sz[28]

; The dictionary would continue, but may not contain entries for

; every possible property. Also entries do not need to be in order

; (except dwPropID == 0 must be first).

; Start of Property 1 (code page indicator)

00D0 02 00 00 00 ; DWORD type indicator (VT_12)

00D4 B0 04 00 00 ; USHORT codepage (0x04B0 == 1200 == Unicode)

; Start of Property 7 (PID_SYMBOL)

0134 1E 00 00 00 ; DWORD type indicator (VT_LPWSTR == 1F)

0138 0A 00 00 00 ; DWORD count of bytes

013C L"MSFT\0" ; WCHAR sz[5] (incl 2 bytes for the NULL)

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples