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
SetWindowLongPtr is not generated #528
Comments
Possibly related to #343 |
This works as you expect when you target x64. AnyCPU or x86 targeted compilations don't get |
If it is by design then that honestly sounds like bad design. When you include
The Win32 api docs say that this function is available. This library is a wrapper around the Win32 api. The function is missing from the wrapper. This should be considered a defect, not "design". |
Not exactly. This is a source generator that transforms a metadata file into C#. It doesn't read header files or try to cover any more than the metadata does in general. In some cases we go slightly beyond it just to make the existing APIs more usable, but we don't add extra APIs. CsWin32 is used with other metadata inputs than Win32Metadata, so in fact adding win32 APIs to other libraries' C# projections would be wholly inappropriate. But I want to give you what you're asking for here. If we can get the codebase to a point where it can be flexible enough to do this, and after we get the defective code generation bugs fixed, we can circle back and look at adding conveniences like this. It's easy for C++ to support what they do because they use macros in the header files. But in C# we can't invoke macros. We can only invoke real exported functions. And sure, we can emit totally custom code to make up for that, but users can write that code themselves too, so we need to prioritize the defect bugs. Thanks for understanding. |
I'm also hearing: contributions potentially welcome. |
Yes, in general they are. But anything more than a trivial change should be presented in an issue with a design proposal before sending a PR to help avoid wasted effort in case it's not a PR we could accept or at least not in a particular form. |
Actual behavior
SetWindowLong
is generated, butSetWindowLongPtr
is not.Expected behavior
SetWindowLongPtr
should be generated to be able to set a pointer value on window.Repro steps
NativeMethods.txt
content:NativeMethods.json
content (if present):N/A
Any of your own code that should be shared?
Context
LangVersion
(if explicitly set by project): 10.0The text was updated successfully, but these errors were encountered: