windows-runtime

Play audio in background by use BackgroundCapableMedia

梦想的初衷 提交于 2019-12-11 00:56:46
问题 In the windows8 Developer preview we can use this code to play audio in background: mediaElement.AudioCategory = AudioCategory.Media; In the windows8 Customer perview, It seems that we should use AudioCategory.BackgroundCapableMedia instead of AudioCategory.Media mediaElement.AudioCategory=AudioCategory.BackgroundCapableMedia; and I also Declare a background task in appxmanifest <Extension Category="windows.backgroundTasks" EntryPoint="TestApp.App"> <BackgroundTasks> <Task Type="audio" /> <

$.Ajax doesnt work in windows8 metro app

送分小仙女□ 提交于 2019-12-11 00:49:48
问题 I am trying to migrate my existing html5 app into a metro app, and finding two major hurdles: .innerHtml is not supported due to security reason $.Ajax just doesn't work (I am using jsonp for data exchange from server) Questions: How do I bypass the security issue for .innerHtml? What other alternative do I have to make $.Ajax work? 回答1: Q2: I had the similar problem, and I changed my $.get to: function getJSON(url, data, callback, errorCb) { if (data != null) { var params = []; for (var key

dependency walker gives me errors on the system that runs correctly

故事扮演 提交于 2019-12-11 00:40:39
问题 I have a missing dll on a system. I have the following message: Could not load file or assembly 'mydll.dll' or one of its dependencies. Of course, 'mydll' is present there, it most probably is another dll on which it depends. I downloaded dependency walker to check what it could be. I have first tested it in another system, where the application has no problems. But if I open mydll.dll with dependency walker on the system where my application does work, it reports eight dlls that should be

“Invalid window handle” error when using FileOpenPicker from C++/WinRT without UWP

假如想象 提交于 2019-12-11 00:30:59
问题 I am trying to use C++/WinRT to write something interesting. Having very little experience in Windows programming and no experience in C++/CX, I started out by trying sample program (OCR). The sample program is about optical character recognition, I modified it to be face detector (console-based). It worked very well. I want to convert getting file from command-line to file dialog, so I ported the following snippet from C#: FileOpenPicker picker = FileOpenPicker(); picker.ViewMode

Remove an item from a list box causes a Catastrophic Failure?

你。 提交于 2019-12-11 00:30:28
问题 I am trying to clear a list box's items in my Windows RT App. To add the items, I use: List<string> list1; ... foreach(string s in list1.Items) { listBox1.Items.Add(s); } To clear the items, I use: listBox1.Items.Clear(); However, this throws this exception: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) If I try to use: int at = 0; while (at < listBox1.Items.Count) { listBox1.Items.RemoveAt(at); at += 1; } I get the same exception at the RemoveAt method. 回答1: I

How to access the Windows.Management.Deployment namespace?

☆樱花仙子☆ 提交于 2019-12-11 00:29:51
问题 I have an integration test suite that I'm trying to extend to allow testing a version of a program for Windows 8. My target work flow is simple: Create appx package, install, run appcert.exe, uninstall package, clean up other stuff So, I'm trying to access the Windows.Management.Deployment namespace which should allow me to do all of the installation and management of the package. Problem is that this namespace apparently requires using the WinRT version of .Net, which won't fly for us

Cloning a Windows Store app - What should be changed?

冷暖自知 提交于 2019-12-11 00:06:53
问题 I need to create a copy of a Windows Store app that will coexist with the original one on the store. I plan to create a copy of the solution folder and then change the package display name in appxmanifest (Packaging). Is there anything else I need to change to prevent conflicts between the apps? 回答1: Changing the package display name won't be sufficient and even it's not needed - you can have two apps with the same name on your phone. The most important is Name (in Identity node) and

How to save data on Windows Store App Close?

社会主义新天地 提交于 2019-12-10 23:59:56
问题 i have the following problem. When the user closes the Windows store app, i want a text file with data to be saved. What method should i write so that when closing the app a file gets saved ? 回答1: This article describes the application lifecycle of a Windows Store App. If you look at the very first figure, you can see that there are only 3 events related to application lifecycle: Activated - Raised when program first starts Suspended - Raised when program is suspended (i.e. the user returns

How to get exported values (MEF) in metro style apps

拟墨画扇 提交于 2019-12-10 21:06:35
问题 I recognized, that MEF is limited for metro style apps. There is no container anymore, so how can I get specific exported values like ILogger logger = container.GetExportedValues<ILogger>(); ? Is the any tutorial available covering the metro version of MEF? Thanks for Help, Eny 回答1: As I already wrote in the comment, I don't really like this approach, but it is the best what I have up to this moment: public class CompositionContainer { private readonly CompositionService _service; public

WinRT & UWP WebView localhost url doesn't fire when app is packaged

泪湿孤枕 提交于 2019-12-10 20:58:04
问题 Boy I'm really struggling with this one! So I have a WinRT Metro application that has an HTML webpage embedded into a webview within the application. In the HTML page there is a div with an href to a localhost url. I'm using this localhost call to communicate with a .NET desktop application that is listening for this url on a localhost port. When I build the application (as debug or release) in Visual Studio (2015, update 1 or 2), the application works as expected. I can click on the div, the