mshtml: Added IHTMLWindow2::toString implementation.

This commit is contained in:
Jacek Caban 2009-08-31 20:45:02 +02:00 committed by Alexandre Julliard
parent f6b846414a
commit 9cf9d20197
2 changed files with 20 additions and 2 deletions

View File

@ -745,8 +745,16 @@ static HRESULT WINAPI HTMLWindow2_execScript(IHTMLWindow2 *iface, BSTR scode, BS
static HRESULT WINAPI HTMLWindow2_toString(IHTMLWindow2 *iface, BSTR *String)
{
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
FIXME("(%p)->(%p)\n", This, String);
return E_NOTIMPL;
static const WCHAR objectW[] = {'[','o','b','j','e','c','t',']',0};
TRACE("(%p)->(%p)\n", This, String);
if(!String)
return E_INVALIDARG;
*String = SysAllocString(objectW);
return *String ? S_OK : E_OUTOFMEMORY;
}
static HRESULT WINAPI HTMLWindow2_scrollBy(IHTMLWindow2 *iface, LONG x, LONG y)

View File

@ -3959,6 +3959,7 @@ static void test_window(IHTMLDocument2 *doc)
IHTMLWindow2 *window, *window2, *self;
IHTMLDocument2 *doc2 = NULL;
IDispatch *disp;
BSTR str;
HRESULT hres;
hres = IHTMLDocument2_get_parentWindow(doc, &window);
@ -3991,6 +3992,15 @@ static void test_window(IHTMLDocument2 *doc)
ok(disp == (void*)window, "disp != window\n");
IDispatch_Release(disp);
hres = IHTMLWindow2_toString(window, NULL);
ok(hres == E_INVALIDARG, "toString failed: %08x\n", hres);
str = NULL;
hres = IHTMLWindow2_toString(window, &str);
ok(hres == S_OK, "toString failed: %08x\n", hres);
ok(!strcmp_wa(str, "[object]"), "toString returned %s\n", wine_dbgstr_w(str));
SysFreeString(str);
IHTMLWindow2_Release(window);
}