You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Module test projects require v145 toolset (VS 2026). Directory.Build.Props sets v143 by default — override with `<PlatformToolset>v145</PlatformToolset>` in Configuration PropertyGroup
29
+
30
+
## Key Patterns
31
+
32
+
### Prebuild Embedding
33
+
The `strings/*.h` files are embedded as string literals by the prebuild step. If you modify any `strings/*.h` file, you must delete `prebuild.exe` and rebuild the entire solution for changes to take effect.
34
+
35
+
### Module Guard Macros
36
+
-`WINRT_IMPL_BUILD_MODULE` — Defined in .ixx global fragment. Makes `WINRT_EXPORT` expand to `export extern "C++"` and suppresses `#include` of dependencies
37
+
-`WINRT_IMPORT_MODULE` — Defined by consumers who import modules. Makes namespace headers no-op (types come from module import)
38
+
-`WINRT_EXPORT` — Empty in header mode, `export extern "C++"` in module mode
-`impl/<ns>.2.h` — Delegates, structs, class implementations
45
+
-`<ns>.h` — Public API surface (consume definitions, class wrappers, operators)
46
+
47
+
### Dependency Collection
48
+
When generating headers with `-modules`, writer.depends is inspected after each header to build a namespace dependency graph. This graph drives SCC detection and module import lists.
49
+
50
+
## Common Gotchas
51
+
52
+
- Module IFCs are NOT compatible across toolset versions — always clean rebuild when switching
53
+
- PCH and modules can coexist but PCH must NOT contain imports from WinRT headers when using modules, and winrt imports are preferred over textual inclusion
54
+
-`/ifcSearchDir` works for the module dependency scanner to find IFCs, but cross-component modules may need explicit `/reference "name=path.ifc"` flags
55
+
-`import std;` requires `BuildStlModules=true`
56
+
- Component modules (-opt) encode direct instantiation — they cannot be shared across DLL boundaries
0 commit comments