Win32 leagacy recompilation error fixes
- Update WINVER and _WIN32_WINNT
Error C1189 #error:
MFC does not support WINVER less than 0x0501. Please change the definition of WINVER in your project properties or precompiled header. PrintDlg c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\atlmfc\include\afxv_w32.h 40
o modify the macros, in a header file (for example, in targetver.h, which is included by some project templates that target Windows), add the following lines.
#define WINVER 0x0A00
#define _WIN32_WINNT 0x0A00
usually defining these macro in stdAfx.h file is good.
- Visual Studio error D8016: '/ZI' and '/Gy' command-line options are incompatible
- #visual studio # Error D8016 '/ZI' and '/Gy-' command-line options are incompatible
Error D8016 '/ZI' and '/Gy-' command-line options are incompatible
solution is:
the same issue got, resolved by changing Project ➔ Properties ➔ C/C++ ➔ General ➔ Debug Information Format ➔ Program Database (/Zi)
- How do I create a variable or constant of type LPOLESTR?
- A light wrapper class for GUID
Error C2664 'int StringFromGUID2(const GUID &,LPOLESTR,int)': cannot convert argument 2 from 'USHORT [100]' to 'LPOLESTR'
Error C2440 '=': cannot convert from 'const char [6]' to 'LPSTR' Tooltips c:\demo\tooltips\tooltips\tooltips.cpp 292
code snippet is: ((NMTTDISPINFO*)hdr)->lpszText = "Lines"; when I build tooltip project in Visual C++ project.
My solution:((NMTTDISPINFO*)hdr)->lpszText = (LPSTR)"Lines";
- Compiler Error C2440
- cannot convert from 'const char *' to 'LPCTSTR'
- cannot convert from 'const char *' to 'LPCTSTR'
- cannot convert from 'const char *' to 'LPCTSTR'
- ERROR C2440
this is official explanation from Microsoft.
No comments:
Post a Comment