This problem was encountered when debugging a multi-target tracking program in vs2008. The problem was ignored in the next release. In the release version, you do not need to worry about this problem, that is, the system helped you block it, but the problem still exists. Such an error is reported in the debug environment.
Error cause:
This code is correct and incorrect on the platform.
Nm. cbsize = sizeof (nonclientmetrics); this is an earlier version, usually known as 0x0501. If the version is lower than the system and vs compiler versions (vs2008/vs2010), problems may occur.
Solution:
In stdafx. h.
# Pragma once
# Ifndef _ secure_atl
# DEFINE _ secure_atl 1
# Endif
# Ifndef vc_extralean
# Definevc_extralean /// Exclude rarely-used stuff from Windows Headers
# Endif
This statement is followed by the following sentence:
# Ifndefwinver // Allows the use of features specific to Windows XP or later.
# Define winver 0x0501 // Change the value to the corresponding value to apply to other versions of Windows.
# Endif
# Ifndef _ win32_winnt // Allows the use of features specific to Windows XP or later.
# DEFINE _ win32_winnt 0x0501// Change the value to the corresponding value to apply to other versions of Windows.
# Endif