Permalink
Browse files

Use GWPL_USERDATA to store the pointer to the WebForm instance

  • Loading branch information...
1 parent 027dd5d commit 3ded31af7fcf099110404c19dcd27ec2234dc523 @Tobbe committed Aug 13, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 webform.cpp
View
6 webform.cpp
@@ -339,13 +339,13 @@ LRESULT CALLBACK WebForm::WebformWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
webf->hhost = hwnd;
#pragma warning(suppress:4244)
- SetWindowLongPtr(hwnd, 0, (LONG_PTR)webf);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)webf);
return DefWindowProc(hwnd, msg, wParam, lParam);
}
#pragma warning(suppress:4312)
- WebForm *webf = (WebForm*)GetWindowLongPtr(hwnd, 0);
+ WebForm *webf = (WebForm*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (webf == NULL) {
return DefWindowProc(hwnd, msg, wParam, lParam);
@@ -369,7 +369,7 @@ LRESULT WebForm::InstanceWndProc(UINT msg, WPARAM wParam, LPARAM lParam)
case WM_DESTROY:
Close();
Release();
- SetWindowLongPtr(hhost, 0, 0);
+ SetWindowLongPtr(hhost, GWLP_USERDATA, 0);
break;
case WM_SETTEXT:
Go((TCHAR*)lParam);

0 comments on commit 3ded31a

Please sign in to comment.