You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to handle the windows error from MediaControls::new that it panics when the program isn't run as Administrator, but I don't see how to convert the error to a WindowsError, only from.
I also can't seem to use error-stack IntoReport on souvlaki errors like other errors, they don't implement std::error::Error.
The Administrator requirement may be from using the existing HWND created by the terminal when opening my program, because I don't spawn a window myself.
#[cfg(not(target_os = "windows"))]let hwnd = None;#[cfg(target_os = "windows")]let hwnd = {use windows::Win32::System::Console::GetConsoleWindow;let console_window = unsafe{GetConsoleWindow()};let hwnd = console_window.0as*mutc_void;Some(hwnd)};let platform_config = PlatformConfig{dbus_name:"VRC_OSC",display_name:"VRC-OSC",
hwnd,};let controls = matchMediaControls::new(platform_config){Ok(controls) => controls,Err(error) => {// I can see the error code when printing but I can't access itprintln!("{:?}",error);panic!("{error:?}")}};
EDIT: I can't seem to set_playback for sources other than my own with set_metadata, is it possible to do this?
The text was updated successfully, but these errors were encountered:
I'm trying to handle the windows error from
MediaControls::new
that it panics when the program isn't run as Administrator, but I don't see how to convert the error to aWindowsError
, only from.I also can't seem to use
error-stack
IntoReport on souvlaki errors like other errors, they don't implementstd::error::Error
.The Administrator requirement may be from using the existing HWND created by the terminal when opening my program, because I don't spawn a window myself.
EDIT: I can't seem to
set_playback
for sources other than my own withset_metadata
, is it possible to do this?The text was updated successfully, but these errors were encountered: