-
Notifications
You must be signed in to change notification settings - Fork 486
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
interface
macro should implement IntoParam
#1618
Labels
enhancement
New feature or request
Comments
MolotovCherry
changed the title
Implement IntoParam for Interfaces
Implement IntoParam for custom Interfaces
Mar 18, 2022
Yes that's missing. Thanks for the reminder. @rylev is still working on that macro. |
kennykerr
changed the title
Implement IntoParam for custom Interfaces
Mar 18, 2022
interface
macro should implement IntoParam
Correction, this seems to work. Here's a complete repro:
use windows::{core::*, Win32::System::WinRT::*};
#[interface("bdbec94c-ae60-49e3-894f-009b1ce9af71")]
pub unsafe trait ISample: IUnknown {
unsafe fn method(&self);
}
#[implement(ISample)]
struct Sample();
impl ISample_Impl for Sample {
unsafe fn method(&self) {}
}
fn main() {
let sample: ISample = Sample().into();
unsafe {
let _ = RoGetAgileReference(AGILEREFERENCE_DEFAULT, &IUnknown::IID, sample);
}
} |
Just saw this on Ryan's PR. My title was incorrect, I should have said |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some methods have signatures like
Where the current custom interfaces defined using
#[interface]
cannot be sent as a parameter to this since they don't seem to implementIntoParam
. It would be convenient if they implemented this so they can be easily passed to functions that require it.Workaround isn't super difficult, something like this works
pUnsecApp.CreateObjectStub::<IUnknown>(event_sink.into())
The text was updated successfully, but these errors were encountered: