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

Generate all members in namespace from nativemethods.txt #259

Closed
AArnott opened this issue May 4, 2021 · 2 comments · Fixed by #300
Closed

Generate all members in namespace from nativemethods.txt #259

AArnott opened this issue May 4, 2021 · 2 comments · Fixed by #300
Assignees
Labels
enhancement New feature or request

Comments

@AArnott
Copy link
Member

AArnott commented May 4, 2021

Is your feature request related to a problem? Please describe.

I want to easily generate everything within a "namespace" from the metadata, whether it by structs, methods, or interfaces.

Describe the solution you'd like

When a namespace is named in the .txt input file, generate all members of it:

CreateFile
windows.win32.ai.machinelearning.directml

Describe alternatives you've considered

A special ns:System.IO.* syntax:

CreateFile
User32.*
ns:windows.win32.ai.machinelearning.directml.*
@wjk
Copy link

wjk commented May 25, 2021

Agreed. This would make things much easier for me. What would make it even better is being able to copy the namespaces from the win32metadata file verbatim into the output C# code, instead of just flattening everything into Windows.Win32 or whatever namespace the user specified. While I might run into name-collision errors in my code if I use two different namespaces both containing a PInvoke (or NativeMethods, or whatever) class, this problem would be easy to fix by adding e.g. using RibbonNativeMethods = Windows.Win32.UI.Ribbon.NativeMethods to the affected files.

@AArnott
Copy link
Member Author

AArnott commented Jun 9, 2021

Thanks for your thoughts, @wjk. In fact our latest version (in our CI feed) already generates types into namespaces.

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