microsoft / microsoft/Windows-classic-samples
RecipeThumbnailProvider: explain -static_cast<LONG>(nHeight)
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 5.7k
- Forks
- 3.3k
- PR merge metrics
- No merged PRs in 30d
Description
The code sample for CRecipeThumbProvider makes an assignment of -static_cast<LONG>(nHeight) to the field biHeight of type LONG, where nHeight is of type UINT.
It is unclear why it is correct to negate the result of the static cast, as a reader of the code might be misled to believe some sort of UINT->INT conversion weirdness to be present. The code sample should have a comment directing the reader to the documentation of BITMAPINFOHEADER.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open Samples/Win7Samples/winui/shell/appshellintegration/RecipeThumbnailProvider/RecipeThumbnailProvider.cpp at the assignment around line 252. Read the BITMAPINFOHEADER documentation linked in the issue to understand the negative height, then add a comment that explains it and points readers to that documentation; done means the sample is clearer without changing its behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100