The last parameter in this function is a pointer to a pointer.
Actually, it is not.
DWORD_PTR is an integral type that is the same size as a pointer (i.e. 32-bit on 32-bit hardware and 64-bit on 64-bit hardware). It is
NOT a pointer type.
The function takes a
PDWORD_PTR, so the parameter passed should be the address of a
DWORD_PTR...
Code: Select all
void CIrrDeviceWin32::setWindowCaption(const wchar_t* text)
{
DWORD_PTR dwResult;
if (IsNonNTWindows)
{
const core::stringc s = text;
SendMessageTimeout(HWnd, WM_SETTEXT, 0,
reinterpret_cast<LPARAM>(s.c_str()),
SMTO_ABORTIFHUNG, 2000, &dwResult);
}
else
SendMessageTimeoutW(HWnd, WM_SETTEXT, 0,
reinterpret_cast<LPARAM>(text),
SMTO_ABORTIFHUNG, 2000, &dwResult);
}
Your suggested fix passes a pointer to a pointer to a
DWORD which is different than the expected parameter type. That is why you had to apply the cast to eliminate the compiler warning.
Travis