comparison win/browser.c @ 2058:f8865a4b5835

Win: Fix warnings when compiling with mingw32 gcc 5.1.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 31 Dec 2019 23:35:59 +0000
parents 53523298c7c7
children 2e804b4db81e
comparison
equal deleted inserted replaced
2057:9c400365f269 2058:f8865a4b5835
1168 HWND hwnd; 1168 HWND hwnd;
1169 1169
1170 /* Get the window handle and URL */ 1170 /* Get the window handle and URL */
1171 vWindow.vt = VT_UI8; 1171 vWindow.vt = VT_UI8;
1172 pwb->lpVtbl->GetProperty(pwb, bstrProp, &vWindow); 1172 pwb->lpVtbl->GetProperty(pwb, bstrProp, &vWindow);
1173 hwnd = (HWND)vWindow.ullVal; 1173 hwnd = (HWND)DW_UINT_TO_POINTER(vWindow.ullVal);
1174 SysFreeString(bstrProp); 1174 SysFreeString(bstrProp);
1175 /* Send the event for signal handling */ 1175 /* Send the event for signal handling */
1176 _wndproc(hwnd, WM_USER+101, (WPARAM)DW_INT_TO_POINTER(DW_HTML_CHANGE_STARTED), (LPARAM)WideToUTF8((LPWSTR)pszURL)); 1176 _wndproc(hwnd, WM_USER+101, (WPARAM)DW_INT_TO_POINTER(DW_HTML_CHANGE_STARTED), (LPARAM)WideToUTF8((LPWSTR)pszURL));
1177 1177
1178 // Make sure you don't accidently cancel the navigation. 1178 // Make sure you don't accidently cancel the navigation.
1188 BSTR locationURL; 1188 BSTR locationURL;
1189 1189
1190 /* Get the window handle and URL */ 1190 /* Get the window handle and URL */
1191 vWindow.vt = VT_UI8; 1191 vWindow.vt = VT_UI8;
1192 pwb->lpVtbl->GetProperty(pwb, bstrProp, &vWindow); 1192 pwb->lpVtbl->GetProperty(pwb, bstrProp, &vWindow);
1193 hwnd = (HWND)vWindow.ullVal; 1193 hwnd = (HWND)DW_UINT_TO_POINTER(vWindow.ullVal);
1194 SysFreeString(bstrProp); 1194 SysFreeString(bstrProp);
1195 pwb->lpVtbl->get_LocationURL(pwb, &locationURL); 1195 pwb->lpVtbl->get_LocationURL(pwb, &locationURL);
1196 /* Send the event for signal handling */ 1196 /* Send the event for signal handling */
1197 _wndproc(hwnd, WM_USER+101, (WPARAM)DW_INT_TO_POINTER(DW_HTML_CHANGE_COMPLETE), (LPARAM)WideToUTF8((LPWSTR)locationURL)); 1197 _wndproc(hwnd, WM_USER+101, (WPARAM)DW_INT_TO_POINTER(DW_HTML_CHANGE_COMPLETE), (LPARAM)WideToUTF8((LPWSTR)locationURL));
1198 break; 1198 break;
1856 webBrowser2->lpVtbl->put_Height(webBrowser2, rect.bottom); 1856 webBrowser2->lpVtbl->put_Height(webBrowser2, rect.bottom);
1857 1857
1858 // Save the window handle as a property for later use 1858 // Save the window handle as a property for later use
1859 VariantInit(&vWindow); 1859 VariantInit(&vWindow);
1860 vWindow.vt = VT_UI8; 1860 vWindow.vt = VT_UI8;
1861 vWindow.ullVal = (ULONGLONG)hwnd; 1861 vWindow.ullVal = (ULONGLONG)DW_POINTER_TO_UINT(hwnd);
1862 bstrProp = SysAllocString(L"DWindow"); 1862 bstrProp = SysAllocString(L"DWindow");
1863 webBrowser2->lpVtbl->PutProperty(webBrowser2, bstrProp, vWindow); 1863 webBrowser2->lpVtbl->PutProperty(webBrowser2, bstrProp, vWindow);
1864 SysFreeString(bstrProp); 1864 SysFreeString(bstrProp);
1865 1865
1866 // Get IWebBrowser2' IConnectionPointContainer sub-object. We do this by calling 1866 // Get IWebBrowser2' IConnectionPointContainer sub-object. We do this by calling
1867 // IWebBrowser2' QueryInterface, and pass it the standard GUID for an 1867 // IWebBrowser2' QueryInterface, and pass it the standard GUID for an
1868 // IConnectionPointContainer VTable 1868 // IConnectionPointContainer VTable
1869 if (!(hr = webBrowser2->lpVtbl->QueryInterface(webBrowser2, &IID_IConnectionPointContainer, &container))) 1869 if (!(hr = webBrowser2->lpVtbl->QueryInterface(webBrowser2, &IID_IConnectionPointContainer, (void **)&container)))
1870 { 1870 {
1871 // Get IWebBrowser2' IConnectionPoint sub-object for specifically giving 1871 // Get IWebBrowser2' IConnectionPoint sub-object for specifically giving
1872 // IWebBRowser2 our DWEventHandler. We do this by calling IConnectionPointContainer's 1872 // IWebBRowser2 our DWEventHandler. We do this by calling IConnectionPointContainer's
1873 // FindConnectionPoint, and pass it DWEventHandler VTable's GUID 1873 // FindConnectionPoint, and pass it DWEventHandler VTable's GUID
1874 hr = container->lpVtbl->FindConnectionPoint(container, &DIID_DWebBrowserEvents2, &point); 1874 hr = container->lpVtbl->FindConnectionPoint(container, &DIID_DWebBrowserEvents2, &point);