diff --git a/cppwinrt/component_writers.h b/cppwinrt/component_writers.h index b8894f8f4..45970c538 100644 --- a/cppwinrt/component_writers.h +++ b/cppwinrt/component_writers.h @@ -988,9 +988,24 @@ namespace winrt::@::implementation static void write_generated_static_assert(writer& w) { auto format = R"( -// Note: Remove this static_assert after copying these generated source files to your project. -// This assertion exists to avoid compiling these generated source files directly. -static_assert(false, "Do not compile generated C++/WinRT source files directly"); +// WARNING: This file is automatically generated by a tool. Do not directly +// add this file to your project, as any changes you make will be lost. +// This file is a stub you can use as a starting point for your implementation. +// +// To add a copy of this file to your project: +// 1. Copy this file from its original location to the location where you store +// your other source files (e.g. the project root). +// 2. Add the copied file to your project. In Visual Studio, you can use +// Project -> Add Existing Item. +// 3. Delete this comment and the 'static_assert' (below) from the copied file. +// Do not modify the original file. +// +// To update an existing file in your project: +// 1. Copy the relevant changes from this file and merge them into the copy +// you made previously. +// +// This assertion helps prevent accidental modification of generated files. +static_assert(false, "This file is generated by a tool and will be overwritten. Open this error and view the comment for assistance."); )"; w.write(format); @@ -1206,4 +1221,4 @@ namespace winrt::@::implementation slot); } } -} \ No newline at end of file +}