本文介绍了“WinMain"的注释不一致的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在努力使我的代码尽可能完美,并且我已经清除了所有错误和(其他)警告.我只剩下这两个:
I'm trying to get my code as perfect as possible, and I've cleaned up all errors and (other) warnings. I'm left with these two:
Warning C28253 Inconsistent annotation for 'WinMain': _Param_(2) has 'SAL_null(__no)' on this instance.
Warning C28252 Inconsistent annotation for 'WinMain': _Param_(2) has 'SAL_null(__maybe)' on the prior instance.
这是我的 WinMain 函数
Here is my WinMain function
int CALLBACK WinMain( _In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nCmdShow );
为什么我的第二个参数 HINSTANCE hPrevInstance
没有正确注释,尽管它是直接从 MSDN 中提取的 _In_
信息?
Why is my second paramater HINSTANCE hPrevInstance
not annotated correctly despite it being ripped straight from MSDN with the _In_
info?
推荐答案
这是因为 hPrevInstance
参数实际上有 _In_opt_
注释,而不仅仅是 _In_代码>.
It is because the hPrevInstance
argument actually has the _In_opt_
annotation rather than just _In_
.
这篇关于“WinMain"的注释不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!