Thursday, February 4, 2021

Warning C28251 Inconsistent annotation for 'WinMain': this instance has no annotations.

when I compiled this project from cp.com, I ran into this error:

Warning C28251 Inconsistent annotation for 'WinMain': this instance has no annotations. See c:\program files (x86)\windows kits\10\include\10.0.18362.0\um\winbase.h(933).

A Good Solution

int APIENTRY _tWinMain(_In_ HINSTANCE hInst, _In_opt_ HINSTANCE hInstPrev, _In_ TCHAR* lpszCmdLine, _In_ int iCmdShow) { }

  1. Custom Controls in Win32 API: Visual Styles
  2. The last time we discussed the basics of custom controls' painting. Today, we will continue in the same direction and we will explore visual styles (a.k.a. XP theming).

    For creation of high quality custom controls, using this API properly is essential, yet a quite complex task, so this article is longer than its predecessors and I kindly ask my readers for some patience when reading it. It will take some time before we really start using the API because first of all, we must take a look at Windows theming from a somewhat broader perspective.

  3. How to Compile Legacy Win32 Programs in Visual Studio 2019?
  4. Some tips on how to compile legacy Win32 programs in Visual Studio 2019 - may save you few hours to figure out why

  5. Code analysis says Inconsistent annotation for 'wWinMain' : this instance has no annotations
  6. The declaration of wWinMain in winbase.h (mentioned in the error) is:

    wWinMain( _In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nShowCmd );

  7. Using SAL Annotations to Reduce C/C++ Code Defects
  8. SAL is the Microsoft source code annotation language. By using source code annotations, you can make the intent behind your code explicit. These annotations also enable automated static analysis tools to analyze your code more accurately, with significantly fewer false positives and false negatives.

  9. This is a paragraph.

  10. This is a paragraph.

  11. This is a paragraph.

  12. This is a paragraph.

  13. This is a paragraph.

  14. This is a paragraph.

  15. This is a paragraph.

  16. This is a paragraph.

  17. This is a paragraph.

  18. This is a paragraph.

  19. This is a paragraph.

  20. This is a paragraph.

  21. This is a paragraph.

  22. This is a paragraph.

No comments:

Post a Comment