windows-runtime

How to declare and link to RoInitialize,RoUninitialize,RoGetActivationFactory and HSTRING Functions in Mingw Gcc

廉价感情. 提交于 2019-12-05 06:41:41
UPDATED: Added what RoInitialize looks like in roapi.h I am in the process of writing a pure C++11 WinRT library. I do not use WRL or C++/CX(Obviously if I want pure C++11). I got my code to compile and run on MSVC, but I want to see if I can get the code to compile and run on Mingw Gcc. Specifically I am using Gcc 4.7.2 obtained from nuwen.net. What I need at this point is a way to call the Windows API Functions RoInitialize RoUnitialize RoGetActivationFactory and the HSTRING Functions WindowsCreateString, WindowsDuplicateString, WindowsDeleteString. I tried compiling this program in G++ but

Remove X button in input - Metro

时光怂恿深爱的人放手 提交于 2019-12-05 06:21:09
问题 I write a Metro program in Javascript. The problem is Windows8 automatically adds an X button to it. Now how to edit or remove that button? Below is my layout, the X button overlaps the email input. 回答1: Details are here: http://msdn.microsoft.com/en-us/library/windows/apps/hh465498.aspx You need to use the -ms-clear pseudo element, and style it either as you need it, or display none it: input::-ms-clear { display: none; } Note that you likely want to not display none it, since this removes

How to P/Invoke to a native dll from Metro?

試著忘記壹切 提交于 2019-12-05 06:04:28
I've got a library consisting of two parts - One .net assembly that P/Invokes to a native 3rd party dll. In desktop mode this works just fine: However, when referencing the assembly from a Metro style app and running it, it throws a System.DllNotFoundException on the P/Invoke complaining that "Unable to load DLL 'library': The specified module could not be found." The native dll does not do anything special but only creates out-going TCP/IP connections to a server. The system cannot know this, but rather the native dll could do anything. This is why I suspect it might not be possible to do

backgroundTaskHost.exe exits with code 1 (0x1)

蹲街弑〆低调 提交于 2019-12-05 05:40:57
I have a Windows Store application that I am creating that has a Windows Runtime Component for a background task. The solution builds with no problems in Visual Studio but when the background task is triggered, it always fails with the message "The program '[4204] backgroundTaskHost.exe' has exited with code 1 (0x1)." The reference to the project containing the background task is in the main project and I am setting the entry point, so I don't know what the problem is. How do I get more information as to why the program is exiting? I was calling an an asynchronous method that returned void. I

Windows Store App UI update

北城余情 提交于 2019-12-05 05:17:25
I am writing a Windows Store App toy application for Windows 8. It has just one xaml page with a TextBlock . The page has the class MyTimer as DataContext : this.DataContext = new MyTimer(); MyTimer implements INotifyPropertyChanged and the updating of the property Time is made with a timer: public MyTimer(){ TimerElapsedHandler f = new TimerElapsedHandler(NotifyTimeChanged); TimeSpan period = new TimeSpan(0, 0, 1); ThreadPoolTimer.CreatePeriodicTimer(f, period); } with private void NotifyTimeChanged(){ if (this.PropertyChanged != null){ this.PropertyChanged(this, new PropertyChangedEventArgs(

Can I use Sqlite in a WinRT application (javascript)?

一曲冷凌霜 提交于 2019-12-05 05:14:27
Is it possible to use a Sqlite database in a windows 8 (winRT) javascript application? What I want to achieve is to download a Sqlite database and store this in local storage before use. I believe some form of local storage is available to javascript based WinRT applications, but I want to know if Sqlite is usable in this scenario. I'm also aware that the .Net implementation of Sqlite uses some win32 calls and I believe these will not be allowed by the windows8 app cerififcation process. JavaScript has HTML5 IndexedDB available to it out of the box. As for SQLite, you can use it, provided that

Why exposed types must be sealed for WinMD/WinRT components?

别来无恙 提交于 2019-12-05 04:51:20
VS compiler does not allow to create sealed exposed types for WINMD type library. Why is this restriction placed ? (I know about sealed types advantages, my question is with respect to Win RT components). This is an architectural limitation, imposed by COM. Which sits at the core of any WinRT type, they are derived from IUnknown and IInspectable. The problem with COM is that it only supports interface inheritance but not implementation inheritance. Which was a strong COM design goal, implementation inheritance is too fraught with implementation details, including the infamous diamond problem.

Windows 8 - BeginAnimation?

╄→гoц情女王★ 提交于 2019-12-05 04:40:14
It seems I can't do myObject.BeginAnimation(dp , animation) . Is this a bug or has it been changed? You need to use a storyboard. Add your animation to the storyboard and have the storyboard begin the animation. var storyboard = new Storyboard(); var opacityAnimation = new DoubleAnimation { From = 0, To = 1, Duration = DurationHelper.FromTimeSpan(TimeSpan.FromSeconds(1)), }; storyboard.Children.Add(opacityAnimation); Storyboard.SetTargetProperty(opacityAnimation, "Opacity"); Storyboard.SetTarget(storyboard, myObject); storyboard.Begin(); 来源: https://stackoverflow.com/questions/8631088/windows

XAML Binding to property

戏子无情 提交于 2019-12-05 04:11:33
I have check box in my XAML+C# Windows Store application. Also I have bool property: WindowsStoreTestApp.SessionData.RememberUser which is public and static. I want check box's property IsChecked to be consistent (or binded, or mapped) to this bool property. I tried this: XAML <CheckBox x:Name="chbRemember1" IsChecked="{Binding Mode=TwoWay}"/> C# chbRemember1.DataContext = SessionData.RememberUser; Code for property: namespace WindowsStoreTestApp { public class SessionData { public static bool RememberUser { get; set; } } } But it doesn't seem to work. Can you help me? You need to implement

How WinRT events are interoperate with .NET

有些话、适合烂在心里 提交于 2019-12-05 04:04:28
In the latest video by Rx team Bart De Smet: Rx Update - .NET 4.5, Async, WinRT I saw that WinRT events exposed to .NET by some really strange metadata, more preciesly - add_ / remove_ pair methods signature: EventRegistrationToken add_MyEvent(EventHandler<MyEventArgs> handler) { … } void remove_MyEvent(EventRegistrationToken registrationToken) { … } It looks really great, allowing unsubscribing from event by "disposing" the registration token (Rx does the same kind of thing, returning IDisposable instance from Subscribe() method). So it's became possible to easily unsubscribe lamba