How to serialize integer to ApplicationDataContainer <p>I am porting an old game to Windows 10 store app. I can write and then read string to app settings:</p> <pre><code>ApplicationDataContainer^ localSettings = ApplicationData::Current-&gt;LocalSettings; localSettings-&gt;Values-&gt;Insert("keyS", "hello"); String^ valueS = safe_cast&lt;String^&gt;(localSettings-&gt;Values-&gt;Lookup("keyS")); </code></pre> <p>I also can put <code>int</code> value:</p> <pre><code>localSettings-&gt;Values-&gt;Insert("keyI", 123); </code></pre> <p>But how do I read it?</p> <pre><code>??? valueI = safe_cast&lt;???&gt;(localSettings-&gt;Values-&gt;Lookup("keyI")); </code></pre> <p><code>Lookup</code> returns <code>Platform::Object^</code>, so how do I cast it to <code>int</code>?</p>