ReneNyffenegger / cpp-MSHTML

Programming the MSHTML Web Browser Control with C++
9 stars 3 forks source link

‘GWL_USERDATA’ was not declared in this scope #1

Open tdtc-hrb opened 11 months ago

tdtc-hrb commented 11 months ago

Windows 10 1809(x64) Cygwin: 3.4.9-1 Gcc: 11.4.0-1 Make: 4.4.1-2

HTMLWindow.cpp:119: error: ‘GWL_USERDATA’ was not declared in this scope; did you mean ‘GWLPUSERDATA’? 119 | SetWindowLong(hwnd, GWL_USERDATA, (LONG)this);

HTMLWindow.cpp:508: error: ‘GWL_USERDATA’ was not declared in this scope; did you mean ‘GWLP_USERDATA’? 508 | HTMLWindow win = reinterpret_cast<HTMLWindow> (::GetWindowLong(hwnd, GWL_USERDATA));

HTMLWindow.cpp:535: error: ‘GWL_USERDATA’ was not declared in this scope; did you mean ‘GWLP_USERDATA’? 535 | HTMLWindow win = reinterpret_cast<HTMLWindow> (::GetWindowLong(hwnd, GWL_USERDATA));

HTMLWindow.cpp:565: error: ‘GWL_USERDATA’ was not declared in this scope; did you mean ‘GWLP_USERDATA’? 565 | HTMLWindow win = reinterpret_cast<HTMLWindow >(::GetWindowLong(hwnd, GWL_USERDATA));

tdtc-hrb commented 11 months ago

https://social.msdn.microsoft.com/Forums/vstudio/en-US/c62b1bf5-6a03-4c66-b24b-ea9fec3f2695/error-c2065-39gwluserdata39-undeclared-identifier

tdtc-hrb commented 11 months ago

SetWindowLong(hwnd_, GWLUSERDATA, (LONG)this); => SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)this);

GetWindowLong(hwnd, GWL_USERDATA) => GetWindowLongPtr(hwnd, GWLP_USERDATA)