How to convert Platform::String to char*?

Here is a very simple way to do this in code w/o having to worry about buffer lengths. Only use this solution if you are certain you are dealing with ASCII: Platform::String^ fooRT = “aoeu”; std::wstring fooW(fooRT->Begin()); std::string fooA(fooW.begin(), fooW.end()); const char* charStr = fooA.c_str(); Keep in mind that in this example, the char* is … Read more

broadFileSystemAccess UWP

This capability is not listed in the “designer” of Package.appxmanifest, you have to add it manually via code. Go to Solution Explorer and right-click Package.appxmanifest. Select View Code. In the code view update the Package element to contain the following: <Package … xmlns:rescap=”http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities” IgnorableNamespaces=”uap mp rescap”> Do not duplicate the IgnorableNamespaces attribute, just append rescap … Read more

Launching a Desktop Application with a Metro-style app

If you simply want to run a desktop application like (notepad, wordpad, internet explorer etc) then go through Process Methods and ProcessStartInfo Class try { // Start the child process. Process p = new Process(); // Redirect the output stream of the child process. p.StartInfo.UseShellExecute = false; p.StartInfo.FileName = “C:\Path\To\App.exe”; p.Start(); } // Exp 2 … Read more

Using jQuery with Windows 8 Metro JavaScript App causes security error

You need to edit the jQuery source so that you pass the jQuery.support function to MSApp.execUnsafeLocalFunction, which disables the unsafe content checking, like this: jQuery.support = MSApp.execUnsafeLocalFunction(function() { var support, all, a, select, opt, input, fragment, tds, events, eventName, i, isSupported, div = document.createElement( “div” ), documentElement = document.documentElement; // lots of statements removed for … Read more

How do I print WebView content in a Windows Store App?

Sure, here you go. First, you can resize the WebView to the actual content. Then, you scale the WebView back to the original size. It would require a script invoke and a ScaleTransform. Pretty simple, really. Like this: <Grid Background=”{StaticResource ApplicationPageBackgroundThemeBrush}”> <WebView x:Name=”MyWebView” Source=”http://www.stackoverflow.com” /> </Grid> void MyWebView_LoadCompleted(object sender, NavigationEventArgs e) { var _Original = … Read more