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
Bug: Win32::Foundation::HINSTANCE
is not generated
#1517
Comments
Thanks! But I think this demands a FAQ entry, many API still uses 'hinstance' as the parameter name and MSDN docs have references to Otherwise the metadata should get rid of 'hinstance' as parameter names also. |
I'll pass this on to the Win32 metadata repo for visibility. |
We can't change parameter names. When everything was That said, I'm curious if we define both
|
Should we make this change? @kennykerr @AArnott @timsneath @marler8997 do you support |
Dart doesn't need an attribute to differentiate between these (we treat them both as |
As long as examples like https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-createwindowexw#example continue to work then this would be an improvement. The example above is passing |
My unqualified opinion is that it seems like there's a new level of complexity added when your type heirachy is more complex than a DAG. I could forsee some languages possibly having problems if AlsoUsableFor could create cycles? Not sure though, just a hunch mostly. As for Zig we can't really do much with AlsoUsableFor except using it to create convenient functions for conversions so these cycles wouldn't be an issue. I think there might be a proposal around adding implicit conversions between opaque types, but I think those are "one-way" meaning the relationship would have to be a DAG. Take this all with a big grain of salt :) |
Yes. |
CsWin32 doesn't support AlsoUsableFor yet. But when it does, I don't anticipate any problems for C# if relationships were cyclical. |
Thanks. So if we make this change, C# users will need to cast HMODULEs to HINSTANCEs in the meantime if they need to convert? |
I don't think a cast would work. They would have to do something like |
Ok. I'd prefer you support the implicit conversion before we make this change. |
Thanks. I'll bump the priority of adding that feature. |
Thanks! |
Which crate is this about?
windows
Crate version
0.48.0
Summary
The type
Win32::Foundation::HINSTANCE
is not generated in0.48.0
of thewindows
crate. I have faced such an issue in the0.47.0
version also.Toolchain version/configuration
Default host: x86_64-pc-windows-msvc
rustup home: C:\Users\momin.rustup
stable-x86_64-pc-windows-msvc (default)
rustc 1.67.1 (d5a82bbd2 2023-02-07)
Reproducible example
Crate manifest
Expected behavior
The type is generated and accessible.
Actual behavior
Not generated.
Additional comments
No response
The text was updated successfully, but these errors were encountered: