Make MONITORINFO a struct
See original GitHub issueThis is possible fix for exception thrown when using CoreRT.
Feedback from CoreRT chatroom :
“Btw, you can work around the GetMonitorInfo trouble by making MONITORINFO a struct and passing it either as a pointer or a ref to the GetMonitorInfo method. The compiler can’t generate marshaling for classes currently”
Error when using WindowStartupLocation:
Unhandled Exception: System.Exception: Method '[Avalonia.Win32]Avalonia.Win32.Interop.UnmanagedMethods.GetMonitorInfo(native int,MONITORINFO)' requires non-trivial marshalling that is not yet supported by this compiler.
at Avalonia.Win32.Interop.UnmanagedMethods.GetMonitorInfo(IntPtr, UnmanagedMethods.MONITORINFO) + 0x23
at Avalonia.Win32.ScreenImpl.<>c__DisplayClass4_0.<get_AllScreens>b__0(IntPtr, IntPtr, Rect&, IntPtr) + 0x82
at Core2D.Avalonia!<BaseAddress>+0x1475a4b
Error when using menus:
Unhandled Exception: System.Exception: Method '[Avalonia.Win32]Avalonia.Win32.Interop.UnmanagedMethods.GetMonitorInfo(native int,MONITORINFO)' requires non-trivial marshalling that is not yet supported by this compiler.
at Avalonia.Win32.Interop.UnmanagedMethods.GetMonitorInfo(IntPtr, UnmanagedMethods.MONITORINFO) + 0x23
at Avalonia.Win32.ScreenImpl.<>c__DisplayClass4_0.<get_AllScreens>b__0(IntPtr, IntPtr, Rect&, IntPtr) + 0x82
at Core2D.Avalonia!<BaseAddress>+0x1475a4b
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
MONITORINFO structure (winuser.h) - Win32 apps
The MONITORINFO structure is a subset of the MONITORINFOEX structure. The MONITORINFOEX structure adds a string member to contain a name for the ......
Read more >Windows API MONITORINFO Structure - c++
If you want to walk the monitor structures, you should use the EnumDisplayMonitors function, and an appropriate callback routine.
Read more >MONITORINFO (user32)
The MONITORINFOEX structure contains information about a display monitor. The GetMonitorInfo function stores information into a ...
Read more >Struct MonitorInfoEx | Dapplo.Windows
A string that specifies the device name of the monitor being used. Most applications have no use for a display monitor name, and...
Read more >C++ : Windows API MONITORINFO Structure
C++ : Windows API MONITORINFO Structure To Access My Live Chat Page, On Google, Search for "hows ... First, Make sure the video...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Avalonia native could probably just supply the monitor info stuff and like you say accessibility. Just where managed code cant be used for whatever reason.
Avalonia.Native is meant for platforms where it’s too hard to properly interop with the native code. Cocoa and Qt are good examples. In case of Win32/GTK/X11 and even Wayland it would be easier to maintain managed code base, since they use plain C API.