Skip to content

MIDL 3.0 (for WinRT/WinUI/XamlIslands) and MIDL 1 (classic COM) in a single project #8107

Answered by DarranRowe
HolgerStrauss asked this question in Q&A
Discussion options

You must be logged in to vote

It actually gets worse. Due to the macros defined in them, the MFC headers actually cause compiler errors in the Windows Runtime headers.
The one that I can recall off of the top of my head is the exception handling stuff in MFC uses a TRY macro. Windows.Globalization.CurrencyIdentifiers has TRY for the Turkish Lira. Including Windows.UI.Xaml.Controls.h forces Windows.Globalization.h to be included too, this means that using Xaml Islands just naturally gets you into this situation. You also can't include Windows.UI.Xaml.Controls.h before the MFC headers because these headers eventually include Windows.h.

I guess you could try to avoid this somewhat if you disable precompiled headers for c…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by HolgerStrauss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants