在visual studio 2005以上版本中使用API创建tootip,创建后发送TTM_ADDTOOL等消息会失败,原因是加载的commctrl dll版本不匹配,解决方法如下:
1 在stdafx.h文件中把 #define _WIN32_WINNT 0x0501 改为 #define _WIN32_WINNT 0x0500
2 在#include "commctrl.h" #pragma comment(lib, "comctl32.lib") 之前加上如下代码:
#if _WIN32_WINNT>0x0500
#if defined _M_IX86
#pragma comment(linker, "/manifestdependency:/"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'/"")
#elif defined _M_IA64
#pragma comment(linker, "/manifestdependency:/"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*&#