From f010ca5e9199e6baae65990ab75a83ea29e4fe18 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Fri, 27 Jun 2025 15:54:10 +0200 Subject: [PATCH] fix(core): compile error without common-controls-v6 (#13719) --- .changes/compile-without-common-controls.md | 5 +++++ crates/tauri-runtime-wry/src/dialog/windows.rs | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changes/compile-without-common-controls.md diff --git a/.changes/compile-without-common-controls.md b/.changes/compile-without-common-controls.md new file mode 100644 index 000000000..2237e97c2 --- /dev/null +++ b/.changes/compile-without-common-controls.md @@ -0,0 +1,5 @@ +--- +tauri-runtime-wry: 'patch:bug' +--- + +Fixed a compile error when using tauri without the `common-controls-v6` feature enabled. diff --git a/crates/tauri-runtime-wry/src/dialog/windows.rs b/crates/tauri-runtime-wry/src/dialog/windows.rs index 137371ef9..2f520c563 100644 --- a/crates/tauri-runtime-wry/src/dialog/windows.rs +++ b/crates/tauri-runtime-wry/src/dialog/windows.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: MIT -use windows::core::{w, HSTRING, PCWSTR}; +use windows::core::{w, HSTRING}; enum Level { Error, @@ -33,7 +33,7 @@ fn dialog_inner(err: &str, level: Level) { unsafe { MessageBoxW( None, - err, + &err, title, match level { Level::Warning => MB_ICONWARNING, @@ -46,7 +46,7 @@ fn dialog_inner(err: &str, level: Level) { #[cfg(feature = "common-controls-v6")] { - use windows::core::HRESULT; + use windows::core::{HRESULT, PCWSTR}; use windows::Win32::Foundation::*; use windows::Win32::UI::Controls::*; use windows::Win32::UI::Shell::*;