comparison win/browser.c @ 2034:89d62197124b

Visual C in C++ mode complains about missing const declarations in paramaters. So adding const to any string parameters which are not written to. Probably going to require changes to the other platforms due to header changes.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sun, 17 Nov 2019 03:13:37 +0000
parents 8a11bb8ec347
children cb195d76de8e
comparison
equal deleted inserted replaced
2033:d81d2ea806c6 2034:89d62197124b
30 #include <crtdbg.h> // for _ASSERT() 30 #include <crtdbg.h> // for _ASSERT()
31 #include <initguid.h> 31 #include <initguid.h>
32 #include "dw.h" 32 #include "dw.h"
33 33
34 /* Import the character conversion functions from dw.c */ 34 /* Import the character conversion functions from dw.c */
35 LPWSTR _myUTF8toWide(char *utf8string, void *outbuf); 35 LPWSTR _myUTF8toWide(const char *utf8string, void *outbuf);
36 char *_myWideToUTF8(LPWSTR widestring, void *outbuf); 36 char *_myWideToUTF8(LPCWSTR widestring, void *outbuf);
37 #define UTF8toWide(a) _myUTF8toWide(a, a ? _alloca(MultiByteToWideChar(CP_UTF8, 0, a, -1, NULL, 0) * sizeof(WCHAR)) : NULL) 37 #define UTF8toWide(a) _myUTF8toWide(a, a ? _alloca(MultiByteToWideChar(CP_UTF8, 0, a, -1, NULL, 0) * sizeof(WCHAR)) : NULL)
38 #define WideToUTF8(a) _myWideToUTF8(a, a ? _alloca(WideCharToMultiByte(CP_UTF8, 0, a, -1, NULL, 0, NULL, NULL)) : NULL) 38 #define WideToUTF8(a) _myWideToUTF8(a, a ? _alloca(WideCharToMultiByte(CP_UTF8, 0, a, -1, NULL, 0, NULL, NULL)) : NULL)
39 LRESULT CALLBACK _wndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2); 39 LRESULT CALLBACK _wndproc(HWND hWnd, UINT msg, WPARAM mp1, LPARAM mp2);
40 BOOL CALLBACK _free_window_memory(HWND handle, LPARAM lParam); 40 BOOL CALLBACK _free_window_memory(HWND handle, LPARAM lParam);
41 41
1360 * specified window, prior to calling this function. You need call 1360 * specified window, prior to calling this function. You need call
1361 * EmbedBrowserObject() once only, and then you can make multiple calls to 1361 * EmbedBrowserObject() once only, and then you can make multiple calls to
1362 * this function to display numerous pages in the specified window. 1362 * this function to display numerous pages in the specified window.
1363 */ 1363 */
1364 1364
1365 int _dw_html_raw(HWND hwnd, char *string) 1365 int _dw_html_raw(HWND hwnd, const char *string)
1366 { 1366 {
1367 IWebBrowser2 *webBrowser2; 1367 IWebBrowser2 *webBrowser2;
1368 LPDISPATCH lpDispatch; 1368 LPDISPATCH lpDispatch;
1369 IHTMLDocument2 *htmlDoc2; 1369 IHTMLDocument2 *htmlDoc2;
1370 IOleObject *browserObject; 1370 IOleObject *browserObject;
1485 * specified window, prior to calling this function. You need call 1485 * specified window, prior to calling this function. You need call
1486 * EmbedBrowserObject() once only, and then you can make multiple calls to 1486 * EmbedBrowserObject() once only, and then you can make multiple calls to
1487 * this function to display numerous pages in the specified window. 1487 * this function to display numerous pages in the specified window.
1488 */ 1488 */
1489 1489
1490 int _dw_html_url(HWND hwnd, char *url) 1490 int _dw_html_url(HWND hwnd, const char *url)
1491 { 1491 {
1492 IWebBrowser2 *webBrowser2; 1492 IWebBrowser2 *webBrowser2;
1493 VARIANT myURL; 1493 VARIANT myURL;
1494 IOleObject *browserObject; 1494 IOleObject *browserObject;
1495 1495
1555 * scriptdata = Pointer to user data to be passed to the callback. 1555 * scriptdata = Pointer to user data to be passed to the callback.
1556 * 1556 *
1557 * RETURNS: 0 if success, or non-zero if an error. 1557 * RETURNS: 0 if success, or non-zero if an error.
1558 */ 1558 */
1559 1559
1560 int _dw_html_javascript_run(HWND hwnd, char *script, void *scriptdata) 1560 int _dw_html_javascript_run(HWND hwnd, const char *script, void *scriptdata)
1561 { 1561 {
1562 IWebBrowser2 *webBrowser2; 1562 IWebBrowser2 *webBrowser2;
1563 IHTMLWindow2 *htmlWindow2; 1563 IHTMLWindow2 *htmlWindow2;
1564 IHTMLDocument2 *htmlDocument2; 1564 IHTMLDocument2 *htmlDocument2;
1565 IOleObject *browserObject; 1565 IOleObject *browserObject;