Structures should provide default ctors that initialize cbSize
members if applicable
#1318
Labels
enhancement
New feature or request
cbSize
members if applicable
#1318
Some structures have a their size as a first member to allow the Win32 API to support different versions of a struct (for example MONITORINFO vs MONITORINFOEX). In recent versions of C# it is possible to provide a parameterless default constructor, which should be used to initialize the cbSize member to the correct size. This will prevent many subtle bugs.
Examples of such structs are:
The text was updated successfully, but these errors were encountered: