Re: Using tooltips with dll
1. 1You should never compare the API return values with TRUE. Ever!
Because any return value != 0 is treated as TRUE.
So you should write:
Code:
if (!SendMessage(hToolTip, TTM_ADDTOOL, 0, LPARAM(&tooltip)))
Logger::Log("Error add tooltip\n"); //////!!!!!!!!Всегда возвращается ошибка!!!
2. Is there any reason you create your POPUPCLASS window in a secondary thread?
Re: Using tooltips with dll
Quote:
Originally Posted by
CoolFaer
I want to create tooltip. When i do this in main exe - all is ok, but when i write this in dll,
SendMessage TTM_ADDTOOL return false always. What's wrong?
Try this:
Code:
TOOLINFO tooltip = {0};
#if (_WIN32_WINNT >= 0x0501)
tooltip.cbSize = TTTOOLINFO_V1_SIZE;
#else
tooltip.cbSize = sizeof(TOOLINFO);
#endif
Re: Using tooltips with dll
One more point. Your dll with no change works fine with an executable that embeds common controls manifest. :) Otherwise the trick I showed you last time is needed.
Code:
if (SendMessage(hToolTip, TTM_ADDTOOL, 0, LPARAM(&tooltip)) != TRUE)
{
tooltip.cbSize = TTTOOLINFO_V1_SIZE;
if (SendMessage(hToolTip, TTM_ADDTOOL, 0, LPARAM(&tooltip)) != TRUE)
Logger::Log("Error add tooltip\n");
}