c++-winrt

How to Get ICoreWindowInterop from CoreWindow

可紊 提交于 2021-02-08 11:37:57
问题 I have a C++/WinRT/UWP project. I need the HWND and HINSTANCE to be able to correctly initialize Direct Input, otherwise DirectInput manage only to enumerate the keyboard and mouse but not the joysticks.. don't ask me why, I even tried to get the TopMostWindow from the HInstance got with GetModule, it just return NULL when running from my C++/WinRT/UWP app, but works when running from a console app. documentation https://docs.microsoft.com/en-us/windows/win32/api/corewindow/nn-corewindow

How to Get ICoreWindowInterop from CoreWindow

扶醉桌前 提交于 2021-02-08 11:36:05
问题 I have a C++/WinRT/UWP project. I need the HWND and HINSTANCE to be able to correctly initialize Direct Input, otherwise DirectInput manage only to enumerate the keyboard and mouse but not the joysticks.. don't ask me why, I even tried to get the TopMostWindow from the HInstance got with GetModule, it just return NULL when running from my C++/WinRT/UWP app, but works when running from a console app. documentation https://docs.microsoft.com/en-us/windows/win32/api/corewindow/nn-corewindow

How to create EGLSurface using C++/WinRT and ANGLE?

坚强是说给别人听的谎言 提交于 2021-01-28 06:44:34
问题 I'm using the Microsoft branch of the ANGLE project to have access to OpenGL in a Universal Windows application. Also I use the C++/WinRT binding to code as much in standard C++ as possible. I started from one of the examples in the ANGLE project and tried to convert the C++/CX code to C++/WinRT code, but I fail to find a solution for the part where I create an EGL Surface: mEGLSurface = eglCreateWindowSurface(mEGLDisplay, config, /*WHERE IS MY HWND?*/, NULL); In the C++/CX they use the

Using winrt::com_ptr<ID3D11Device1> with D3D11CreateDevice()?

对着背影说爱祢 提交于 2020-12-07 05:17:46
问题 I've been studying the code from the DirectXTK example project and trying to implement it in a new project. It seems like Microsoft recommends using WinRT in new projects, though, so I decided I would try to switch instances of WRL::ComPtr to winrt::com_ptr . I'm stuck, though, trying to move between ID3D11Device1 in the project's Game class and ID3DDevice in D3D11CreateDevice() . Here's the example code, slightly abstracted for simplicity's sake: ComPtr<ID3D11Device1> global_device; void

Using winrt::com_ptr<ID3D11Device1> with D3D11CreateDevice()?

荒凉一梦 提交于 2020-12-07 05:15:48
问题 I've been studying the code from the DirectXTK example project and trying to implement it in a new project. It seems like Microsoft recommends using WinRT in new projects, though, so I decided I would try to switch instances of WRL::ComPtr to winrt::com_ptr . I'm stuck, though, trying to move between ID3D11Device1 in the project's Game class and ID3DDevice in D3D11CreateDevice() . Here's the example code, slightly abstracted for simplicity's sake: ComPtr<ID3D11Device1> global_device; void

Using winrt::com_ptr<ID3D11Device1> with D3D11CreateDevice()?

只谈情不闲聊 提交于 2020-12-07 05:14:59
问题 I've been studying the code from the DirectXTK example project and trying to implement it in a new project. It seems like Microsoft recommends using WinRT in new projects, though, so I decided I would try to switch instances of WRL::ComPtr to winrt::com_ptr . I'm stuck, though, trying to move between ID3D11Device1 in the project's Game class and ID3DDevice in D3D11CreateDevice() . Here's the example code, slightly abstracted for simplicity's sake: ComPtr<ID3D11Device1> global_device; void

Get SystemMediaTransportControls for other window

岁酱吖の 提交于 2020-07-10 10:32:10
问题 I'm interesting in ISystemMediaTransportControlsInterop::GetForWindow method. The documentation is outdated for it. But I have found files SystemMediaTransportControlsInterop.h and SystemMediaTransportControlsInterop.idl in folder C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um of Windows SDK. They are describing GetForWindow method. So, how can I get an instance of ISystemMediaTransportControlsInterop and call this method? WinRT contains only method

Xbox 360 Wireless Controller is not working via C++/WinRT and Windows.Gaming.Input API in console application

落爺英雄遲暮 提交于 2020-06-13 07:08:06
问题 I trying to use Windows.Gaming.Input API via C++/WinRT from Windows Console Application and it is not working as supposed with Xbox 360 Wireless Controller (reported as Xbox 360 Wireless Receiver for Windows (0x045e:0x0000) ). I got GamepadAdded event, then trying to read gamepad state via gamepad.GetCurrentReading() and seems GamepadReading struct is not filled at all for Xbox 360 Wireless Controller . Also I found that there is some strange error message on MSVS debug console: onecoreuap

Xbox 360 Wireless Controller is not working via C++/WinRT and Windows.Gaming.Input API in console application

烂漫一生 提交于 2020-06-13 07:06:59
问题 I trying to use Windows.Gaming.Input API via C++/WinRT from Windows Console Application and it is not working as supposed with Xbox 360 Wireless Controller (reported as Xbox 360 Wireless Receiver for Windows (0x045e:0x0000) ). I got GamepadAdded event, then trying to read gamepad state via gamepad.GetCurrentReading() and seems GamepadReading struct is not filled at all for Xbox 360 Wireless Controller . Also I found that there is some strange error message on MSVS debug console: onecoreuap

Equivalent of Platform::IBoxArray in C++/WinRT

大憨熊 提交于 2020-05-31 06:29:12
问题 I am currently porting an UWP application from C++/CX to C++/WinRT. I encountered a safe_cast<Platform::IBoxArray<byte>^>(data) where data is of type Windows::Foundation::IInspectable ^ . I know that the safe_cast is represented by the as<T> method, and I know there are functions for boxing ( winrt::box_value ) and unboxing ( winrt::unbox_value ) in WinRT/C++. However, I need to know the equivalent of Platform::IBoxArray in order to perform the cast (QueryInterface). According to https://docs