- //We send the events when we are done to mimic webkit
- //Navigated event
- wxWebNavigationEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATED,
- GetId(), baseUrl, "", false);
- event.SetEventObject(this);
- HandleWindowEvent(event);
-
- //Document complete event
- event.SetEventType(wxEVT_COMMAND_WEB_VIEW_LOADED);
- event.SetEventObject(this);
- HandleWindowEvent(event);
+ bstr = SysAllocString(html.wc_str());
+
+ // Creates a new one-dimensional array
+ psaStrings = SafeArrayCreateVector(VT_VARIANT, 0, 1);
+ if (psaStrings != NULL)
+ {
+ hr = SafeArrayAccessData(psaStrings, (LPVOID*)¶m);
+ param->vt = VT_BSTR;
+ param->bstrVal = bstr;
+ hr = SafeArrayUnaccessData(psaStrings);
+
+ document = GetDocument();
+ document->write(psaStrings);
+ document->Release();
+
+ // SafeArrayDestroy calls SysFreeString for each BSTR
+ SafeArrayDestroy(psaStrings);
+
+ //We send the events when we are done to mimic webkit
+ //Navigated event
+ wxWebViewEvent event(wxEVT_COMMAND_WEB_VIEW_NAVIGATED,
+ GetId(), baseUrl, "");
+ event.SetEventObject(this);
+ HandleWindowEvent(event);
+
+ //Document complete event
+ event.SetEventType(wxEVT_COMMAND_WEB_VIEW_LOADED);
+ event.SetEventObject(this);
+ HandleWindowEvent(event);
+ }
+ else
+ {
+ wxLogError("wxWebViewIE::SetPage() : psaStrings is NULL");
+ }