-
Notifications
You must be signed in to change notification settings - Fork 513
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
implement
/interface
macro docs are outdated
#3302
Labels
bug
Something isn't working
Comments
ver:0.57 can compile,seem that some change in v0.58 lead this error |
This changed here: #3065 Looks like the doc comments are not being compiled. Will have to look into that. |
Here's a complete example that should work: #![allow(non_snake_case)]
use windows_core::*;
#[interface("094d70d6-5202-44b8-abb8-43860da5aca2")]
unsafe trait IValue: IUnknown {
fn GetValue(&self, value: *mut i32) -> HRESULT;
}
#[implement(IValue)]
struct Value(i32);
impl IValue_Impl for Value_Impl {
unsafe fn GetValue(&self, value: *mut i32) -> HRESULT {
*value = self.0;
HRESULT(0)
}
}
fn main() -> Result<()> {
let object: IValue = Value(123).into();
let mut value = 0;
unsafe { object.GetValue(&mut value).ok()? };
println!("{value}");
Ok(())
} |
kennykerr
changed the title
implement macro can not work on the demo that doc show?
Oct 1, 2024
implement
/interface
macro docs are outdated
thanks,that work |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
ver: windows-rs 0.58
get compile error=>
Crate manifest
No response
Crate code
No response
The text was updated successfully, but these errors were encountered: