Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`the trait bound PWSTR: CanInto<PCWSTR> is not satisfied` #2887

Closed
wuweiran opened this issue Feb 27, 2024 · 1 comment · Fixed by #2899
Closed

`the trait bound PWSTR: CanInto<PCWSTR> is not satisfied` #2887

wuweiran opened this issue Feb 27, 2024 · 1 comment · Fixed by #2899
Labels
enhancement New feature or request

Comments

@wuweiran
Copy link
Member

Summary

Windows APIs often expect PCWSTR parameters for read-only input.
By allowing PWSTR to be converted into PCWSTR, Rust code can seamlessly interact with Windows APIs without explicit conversions.

Crate manifest

No response

Crate code

let file_path = item.GetDisplayName(SIGDN_FILESYSPATH)?;
MessageBoxW(None, file_path, w!("File Path"), MB_OK);
@wuweiran wuweiran added the bug Something isn't working label Feb 27, 2024
@wuweiran wuweiran changed the title the trait bound PWSTR: CanInto<PCWSTR> is not satisfied the trait bound \PWSTR: CanInto<PCWSTR>\ is not satisfied Feb 27, 2024
@wuweiran wuweiran changed the title the trait bound \PWSTR: CanInto<PCWSTR>\ is not satisfied the trait bound PWSTR: CanInto<PCWSTR> is not satisfied Feb 27, 2024
@wuweiran wuweiran changed the title the trait bound PWSTR: CanInto<PCWSTR> is not satisfied `the trait bound PWSTR: CanInto<PCWSTR> is not satisfied` Feb 27, 2024
@kennykerr kennykerr added question Further information is requested and removed bug Something isn't working labels Feb 27, 2024
@kennykerr kennykerr added enhancement New feature or request and removed question Further information is requested labels Feb 28, 2024
@kennykerr
Copy link
Collaborator

Seems reasonable. I've added support for this here: #2899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants