-
Notifications
You must be signed in to change notification settings - Fork 263
Allow to build a projection out of a component #1041
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
Conversation
|
I will look into this but it might be a bit until I have time. |
|
No problem, this isn't anything urgent |
|
Is "this option" |
|
Yeah, will add docs. Should I expose it in the VS properties dialog? |
|
The change as authored doesn't make sense. You're inside the GenerateComponentProjection target and you add a flag to make it not generate a component. Doesn't seem right. As far suggesting an alternative I'm not sure I fully understand what you're trying to achieve. |
|
It seems like what you want is to generate WinMD from idl and then generate a reference projection for the WinMD just created? |
|
Yes, exactly. I want to add IDL to a project representing some third-party API, and then having headers generated so that I can consume it (assume it's activatable, for example via reg-free WinRT). In my specific use case, I want to use some APIs from the UDK that is shipped in Windows 11 ( So instead I got IDL from This PR was admittedly a quick workaround to get static members and constructors to work, maybe there's a better way to do this I'm not aware of? |
|
@sylveon there are no documented Windows APIs in that metadata file, but do let us know what you’d like added in a future release or over on github.com/Microsoft/windowsappsdk … winappsdk is a reasonable place to put a real documented thing that knows how to invoke the UDK component. |
|
This is a very very very specific use case, but I use I originally didn't want to mention my exact use case because I expected a reply like that. It doesn't make the original need any less valid however: not wanting to check-in third-party winmd files, third-party provided IDL, etc. |
|
Ignoring the specific use case, the idea of needing to generate a projection from some IDL seems sound. |
|
I see that if I create a C++ WinRT universal component project and then delete everything except the .idl files it builds the .winmd file from the .idl. I set the project namespace to the root of what I wanted in the .winmd and that collected all of the types. but I see when I try to reference this from a C++ WinRT console project I get an error Update: I change the project type to static lib and was able to create the reference. but then mdmerge hits problems in the dependent project. looking more but I may give up for the weekend. |
|
I think adding the |
I agree. It might be a bit before I have time to add support. I'm thinking to support metadata on an idl file that we can use to split idl files in two groups. Group 1 will work as today, while Group 2 will generate a reference projection. That way the changes are mostly additive and will have the least amount of impact on existing projects. |
|
Great, then why don't we create an issue and close this PR for now? What do you think @sylveon? |
|
Sounds good to me! |
|
Opened #1048 |
This option comes in handy when you are writing IDL files in your projects not to produce a component but to consume some API without needing to carry the WinMD around (e.g. only consuming some parts of the API, not wanting to check in binaries to source control, third-party provides an IDL, etc). Without this change, you would face issues with trying to call static functions or constructors, because it was expecting an implementation to be present from a
.g.cppfile while there is none (since you are not actually implementing the API).