windows-8

Porting CreateThread calls to Win8 / WinRT App

霸气de小男生 提交于 2019-12-13 18:14:36
问题 I need to call a C++ library from my C# Win8/WinRT app. The library is multithreaded and manages threads through calls to the Win32 API ( WaitForSingleObject , etc.). I was able to figure out the replacements for all these calls (there is always a ...Ex version available for Apps, e.g. WaitForSingleObjectEx from <synchapi.h> see there if you're looking for it). But there is one call I cannot figure out how to replace: it is a call to the CreateThread function. There is no equivalent, so it

Deliver data in local storage on Windows 8

故事扮演 提交于 2019-12-13 18:07:23
问题 Is it possible to send some data already in the local storage in an Windows 8 app? I'm using a file based database in my project and want to deliever the whole database to the user so that I don't have to create all entries (more than 350). You can find the data of the local storage in C:\Users\ username \AppData\Local\Packages, but there I cannot save information out of my app. Perhaps you have an idea. Thanks. 回答1: The way I did it in the past, to allow writing data to the file was... Add

Does .NET 4.0 business API's work with Win 8 Metro Apps?

纵饮孤独 提交于 2019-12-13 17:27:06
问题 We have a huge sets of business APIs/assemblies developed in .NET 4.0 (most of those were upgraded from .NET 2.0). They are not currently exposed as web services. We would like to start Win 8 metro app development (using C#/XAML) based on those API's. Is it possible? 回答1: Another option is to target the Portable Class Library (PLC) http://msdn.microsoft.com/en-us/library/gg597391.aspx This way you can compile a single assembly to multi target both normal .net and Metro/WinRT .net. You will of

Why is identifier for secondary tile invalid?

[亡魂溺海] 提交于 2019-12-13 16:27:42
问题 I am trying to update a Windows 8 secondary tile directly using XML. However, I keep getting an exception that the identifier for the tile I pinned is invalid. I even tried pulling the identifier directly from Windows and then substituting that back into CreateTileUpdaterForSecondaryTile , but I'm still getting the same exception. Here's my code: public async static void UpdateSecondarySectionTile() { string tileXmlString = "<tile id='SecondaryTile-7-0'>" + "<visual>" + "<binding template=

Windows 8 metro application access arbitrary file path

倖福魔咒の 提交于 2019-12-13 16:18:35
问题 In metro, the codes like following will throw exception: String fileName = @"C:\Test\dd\ccc.jpg"; StorageFile file = await StorageFile.GetFileFromPathAsync(fileName); However even if I check everything in capabilities, also File Picker was added and all file types allowed. I still can't access this file, the same exception will be thrown. Does someone know how to read file in arbitrary file path? Is that possible in metro style application. 回答1: Not possible. You can get to the Libraries -

SimpleOrientationSensor returning Null

跟風遠走 提交于 2019-12-13 15:12:13
问题 I'm using SimpleOrientationSensor to get the screen orientation information in my application. I'm testing this application in Windows Simulator but I always get the sensor object's value as null. This is what I'm doing: SimpleOrientationSensor sensor; sensor = SimpleOrientationSensor.GetDefault(); if (sensor != null) { sensor.OrientationChanged += sensor_OrientationChanged; } I understand that SimpleOrientationSensor.GetDefault() will return null when there is no Sensor available. Should I

unable to use IPAddress or similar type in windows 8 metro style apps

强颜欢笑 提交于 2019-12-13 14:32:55
问题 I am finding difficulty in using System.Net.IPAddress or any similar types in Windows 8 Metro Apps. I am creating an application that will run in an intranet environment and the users will connect to remote servers using IPAddress. But somehow I am not able to use it. Also, in Windows.Networking.EndpointPair class, I cant find any option to pass IPAddress specifically Kindly help with this. Thanx of help in advance 回答1: You can use the HostName class to represent an IP Address. When you

How to show data from array in windows 8 app

泪湿孤枕 提交于 2019-12-13 13:56:02
问题 I have a problem displaying information in an array with windows 8 app, I send information to the view with this. var details = document.querySelector(".articlesection"); var data = [{ "id": "1", "title": "Title text", "files": [ { "id": "1", "title": "File1" }, { "id": "2", "title": "File2" } ] }]; binding.processAll(details, data); I receive the data in the view like this (This works, but cant get info from the files array) <div class="articlesection"> <h2 data-win-bind="textContent: title"

Equivelant of .NET GeoCoordinate.GetDistanceTo in Windows 8 Metro style Apps

て烟熏妆下的殇ゞ 提交于 2019-12-13 13:24:53
问题 What is the equivelant of the System.Device.Location.GeoCoordinate.GetDistanceTo method in Metro style Windows 8 Applications. Metro applications have the Geocoordinate class (With a lower case 'C') but no GetDistanceTo method. Secondly, the Metro Geocoordinate class has no constructor. How can I create an instance of it. 回答1: The Metro Geocoordinate has no public constructor for some reason. The best way to implement this in my opinion is to use Reflector and copy the implementation of

Surface SDK only for surface

☆樱花仙子☆ 提交于 2019-12-13 12:40:20
问题 This might be a stupid question, but I couldn't find the answer anywhere. Does the Microsoft Surface SDK 2.0 only work with Microsoft Surface products, or can I use it with other touchscreens? I really just like the way the SurfaceTextBox control works (popping up a onscreen keyboard when clicked) and was wondering if I could use it in a program I'm making (which uses a Elo touchscreen monitor, not multi-touch). Edit Thanks for the responses. I downloaded and installed the SDK 2.0 and tried