Crates.io | windows-strings |
lib.rs | windows-strings |
version | |
source | src |
created_at | 2024-02-02 16:43:56.130574+00 |
updated_at | 2025-03-18 14:25:41.300351+00 |
description | Windows string types |
homepage | |
repository | https://github.com/microsoft/windows-rs |
max_upload_size | |
id | 1124552 |
Cargo.toml error: | TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
The windows-strings crate provides common Windows string types used by various Windows APIs.
Start by adding the following to your Cargo.toml file:
[dependencies.windows-strings]
version = "0.4"
Use the Windows string types as needed:
use windows_strings::*;
const A: PCSTR = s!("ansi");
const W: PCWSTR = w!("wide");
fn main() {
let b = BSTR::from("bstr");
let h = HSTRING::from("hstring");
assert_eq!(b, "bstr");
assert_eq!(h, "hstring");
assert_eq!(unsafe { A.to_string().unwrap() }, "ansi");
assert_eq!(unsafe { W.to_string().unwrap() }, "wide");
}