#include "IEHtmlWin.h"
#include <wx/strconv.h>
+#include <wx/string.h>
#include <wx/event.h>
#include <wx/listctrl.h>
+#include <wx/mstream.h>
#include <oleidl.h>
#include <winerror.h>
#include <exdispid.h>
public:
FS_DWebBrowserEvents2(wxIEHtmlWin *iewin) : m_iewin(iewin) {}
- ~FS_DWebBrowserEvents2()
+ ~FS_DWebBrowserEvents2()
{
}
//IDispatch
STDMETHODIMP GetIDsOfNames(REFIID r, OLECHAR** o, unsigned int i, LCID l, DISPID* d)
- {
+ {
return E_NOTIMPL;
};
STDMETHODIMP GetTypeInfo(unsigned int i, LCID l, ITypeInfo** t)
- {
+ {
return E_NOTIMPL;
};
STDMETHODIMP GetTypeInfoCount(unsigned int* i)
- {
+ {
return E_NOTIMPL;
};
WORD wFlags, DISPPARAMS * pDispParams,
VARIANT * pVarResult, EXCEPINFO * pExcepInfo,
unsigned int * puArgErr)
- {
+ {
if (wFlags & DISPATCH_PROPERTYGET)
return E_NOTIMPL;
case DISPID_BEFORENAVIGATE2:
if (Process(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, STR_ARG(5)))
*pDispParams->rgvarg->pboolVal = VARIANT_FALSE;
- else
+ else
*pDispParams->rgvarg->pboolVal = VARIANT_TRUE;
break;
case DISPID_NEWWINDOW2:
if (Process(wxEVT_COMMAND_MSHTML_NEWWINDOW2))
*pDispParams->rgvarg->pboolVal = VARIANT_FALSE;
- else
+ else
*pDispParams->rgvarg->pboolVal = VARIANT_TRUE;
break;
case DISPID_PROGRESSCHANGE:
Post(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, "", LONG_ARG(1), LONG_ARG(0));
break;
-
+
case DISPID_DOCUMENTCOMPLETE:
Post(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, STR_ARG(0));
break;
const wxPoint& pos,
const wxSize& size,
long style,
- const wxString& name) :
+ const wxString& name) :
wxActiveX(parent, PROGID, id, pos, size, style, name)
{
SetupBrowser();
{
wxAutoOleInterface<IHTMLDocument2> doc(IID_IHTMLDocument2, disp);
if (doc.Ok())
- doc->put_charset((BSTR) (const wchar_t*)charset.wc_str(wxConvUTF8));
+ doc->put_charset((BSTR) (const wchar_t *) charset.wc_str(wxConvUTF8));
+ //doc->put_charset((BSTR) wxConvUTF8.cMB2WC(charset).data());
};
};
istream *m_is;
public:
-
- IStreamAdaptor(istream *is) : IStreamAdaptorBase(), m_is(is)
+
+ IStreamAdaptor(istream *is) : IStreamAdaptorBase(), m_is(is)
{
wxASSERT(m_is != NULL);
}
- ~IStreamAdaptor()
+ ~IStreamAdaptor()
{
delete m_is;
}
};
};
+class IwxStreamAdaptor : public IStreamAdaptorBase
+{
+private:
+ wxInputStream *m_is;
+
+public:
+
+ IwxStreamAdaptor(wxInputStream *is) : IStreamAdaptorBase(), m_is(is)
+ {
+ wxASSERT(m_is != NULL);
+ }
+ ~IwxStreamAdaptor()
+ {
+ delete m_is;
+ }
+
+ // ISequentialStream
+ HRESULT STDMETHODCALLTYPE Read(void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbRead)
+ {
+ m_is->Read((char *) pv, cb);
+ if (pcbRead)
+ *pcbRead = m_is->LastRead();
+
+ return S_OK;
+ };
+};
void wxIEHtmlWin::LoadUrl(const wxString& url)
{
VARIANTARG navFlag, targetFrame, postData, headers;
- navFlag.vt = VT_EMPTY;
+ navFlag.vt = VT_EMPTY;
navFlag.vt = VT_I2;
navFlag.iVal = navNoReadFromCache;
targetFrame.vt = VT_EMPTY;
headers.vt = VT_EMPTY;
HRESULT hret = 0;
- hret = m_webBrowser->Navigate((BSTR) (const wchar_t*)url.wc_str(wxConvUTF8),
- &navFlag, &targetFrame, &postData, &headers);
+ hret = m_webBrowser->Navigate((BSTR) (const wchar_t *) url.wc_str(wxConvUTF8),
+ &navFlag, &targetFrame, &postData, &headers);
};
+class wxOwnedMemInputStream : public wxMemoryInputStream
+{
+public:
+ char *m_data;
+
+ wxOwnedMemInputStream(char *data, size_t len) :
+ wxMemoryInputStream(data, len), m_data(data)
+ {}
+ ~wxOwnedMemInputStream()
+ {
+ free(m_data);
+ }
+};
bool wxIEHtmlWin::LoadString(wxString html)
{
- string s = html.mb_str(wxConvUTF8);
- istringstream *is = new istringstream(s);
- return LoadStream(is);
+ char *data = NULL;
+ size_t len = html.length();
+#ifdef UNICODE
+ len *= 2;
+#endif
+ data = (char *) malloc(len);
+ memcpy(data, html.c_str(), len);
+ return LoadStream(new wxOwnedMemInputStream(data, len));
};
-bool wxIEHtmlWin::LoadStream(istream *is)
+bool wxIEHtmlWin::LoadStream(IStreamAdaptorBase *pstrm)
{
- // wrap reference around stream
- IStreamAdaptor *pstrm = new IStreamAdaptor(is);
- pstrm->AddRef();
-
wxAutoOleInterface<IStream> strm(pstrm);
// Document Interface
return false;
};
+bool wxIEHtmlWin::LoadStream(istream *is)
+{
+ // wrap reference around stream
+ IStreamAdaptor *pstrm = new IStreamAdaptor(is);
+ pstrm->AddRef();
+
+ return LoadStream(pstrm);
+};
+
+bool wxIEHtmlWin::LoadStream(wxInputStream *is)
+{
+ // wrap reference around stream
+ IwxStreamAdaptor *pstrm = new IwxStreamAdaptor(is);
+ pstrm->AddRef();
+
+ return LoadStream(pstrm);
+};
+
+
bool wxIEHtmlWin::GoBack()
{
HRESULT hret = 0;
BSTR text = NULL;
HRESULT hr = E_FAIL;
-
+
if (asHTML)
hr = tr->get_htmlText(&text);
else
// get inner text
BSTR text = NULL;
hr = E_FAIL;
-
+
if (asHTML)
hr = body->get_innerHTML(&text);
else
wxString s = text;
SysFreeString(text);
- return s;
-};
+ return s;
+};
\ No newline at end of file
#include "wxPython.h"
#include "IEHtmlWin.h"
+#include "pyistream.h"
static PyObject* t_output_helper(PyObject* target, PyObject* o) {
return _resultobj;
}
+#define wxIEHtmlWin_LoadStream(_swigobj,_swigarg0) (_swigobj->LoadStream(_swigarg0))
+static PyObject *_wrap_wxIEHtmlWin_LoadStream(PyObject *self, PyObject *args, PyObject *kwargs) {
+ PyObject * _resultobj;
+ bool _result;
+ wxIEHtmlWin * _arg0;
+ wxInputStream * _arg1;
+ PyObject * _argo0 = 0;
+ wxPyInputStream * temp;
+ bool created;
+ PyObject * _obj1 = 0;
+ char *_kwnames[] = { "self","is", NULL };
+
+ self = self;
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxIEHtmlWin_LoadStream",_kwnames,&_argo0,&_obj1))
+ return NULL;
+ if (_argo0) {
+ if (_argo0 == Py_None) { _arg0 = NULL; }
+ else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
+ PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_LoadStream. Expected _wxIEHtmlWin_p.");
+ return NULL;
+ }
+ }
+{
+ if (SWIG_GetPtrObj(_obj1, (void **) &temp, "_wxPyInputStream_p") == 0) {
+ _arg1 = temp->m_wxis;
+ created = FALSE;
+ } else {
+ _arg1 = wxPyCBInputStream_create(_obj1, FALSE);
+ if (_arg1 == NULL) {
+ PyErr_SetString(PyExc_TypeError,"Expected _wxInputStream_p or Python file-like object.");
+ return NULL;
+ }
+ created = TRUE;
+ }
+}
+{
+ PyThreadState* __tstate = wxPyBeginAllowThreads();
+ _result = (bool )wxIEHtmlWin_LoadStream(_arg0,_arg1);
+
+ wxPyEndAllowThreads(__tstate);
+ if (PyErr_Occurred()) return NULL;
+} _resultobj = Py_BuildValue("i",_result);
+{
+ if (created)
+ delete _arg1;
+}
+ return _resultobj;
+}
+
#define wxIEHtmlWin_SetCharset(_swigobj,_swigarg0) (_swigobj->SetCharset(_swigarg0))
static PyObject *_wrap_wxIEHtmlWin_SetCharset(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
{ "wxIEHtmlWin_GetEditMode", (PyCFunction) _wrap_wxIEHtmlWin_GetEditMode, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_SetEditMode", (PyCFunction) _wrap_wxIEHtmlWin_SetEditMode, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_SetCharset", (PyCFunction) _wrap_wxIEHtmlWin_SetCharset, METH_VARARGS | METH_KEYWORDS },
+ { "wxIEHtmlWin_LoadStream", (PyCFunction) _wrap_wxIEHtmlWin_LoadStream, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_LoadString", (PyCFunction) _wrap_wxIEHtmlWin_LoadString, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_LoadUrl", (PyCFunction) _wrap_wxIEHtmlWin_LoadUrl, METH_VARARGS | METH_KEYWORDS },
{ "new_wxIEHtmlWin", (PyCFunction) _wrap_new_wxIEHtmlWin, METH_VARARGS | METH_KEYWORDS },
class wxActiveX;
-class FrameSite :
+class FrameSite :
public IOleClientSite,
public IOleInPlaceSiteEx,
public IOleInPlaceFrame,
STDMETHODIMP RequestBorderSpace(LPCBORDERWIDTHS);
STDMETHODIMP SetBorderSpace(LPCBORDERWIDTHS);
STDMETHODIMP SetActiveObject(IOleInPlaceActiveObject*, LPCOLESTR);
-
+
//IOleInPlaceFrame
STDMETHODIMP InsertMenus(HMENU, LPOLEMENUGROUPWIDTHS);
STDMETHODIMP SetMenu(HMENU, HOLEMENU, HWND);
STDMETHODIMP CanInPlaceActivate();
STDMETHODIMP OnInPlaceActivate();
STDMETHODIMP OnUIActivate();
- STDMETHODIMP GetWindowContext(IOleInPlaceFrame**, IOleInPlaceUIWindow**,
+ STDMETHODIMP GetWindowContext(IOleInPlaceFrame**, IOleInPlaceUIWindow**,
LPRECT, LPRECT, LPOLEINPLACEFRAMEINFO);
STDMETHODIMP Scroll(SIZE);
STDMETHODIMP OnUIDeactivate(BOOL);
STDMETHODIMP GetObject(LPOLESTR, DWORD, IBindCtx*, REFIID, void**);
STDMETHODIMP GetObjectStorage(LPOLESTR, IBindCtx*, REFIID, void**);
STDMETHODIMP IsRunning(LPOLESTR);
-
+
//IDispatch
STDMETHODIMP GetIDsOfNames(REFIID, OLECHAR**, unsigned int, LCID, DISPID*);
STDMETHODIMP GetTypeInfo(unsigned int, LCID, ITypeInfo**);
bool m_bInPlaceActive;
bool m_bUIActive;
bool m_bWindowless;
-
+
LCID m_nAmbientLocale;
{
m_bAmbientUserMode = true;
m_docAdviseCookie = 0;
- CreateActiveX((LPOLESTR) (const wchar_t*)progId.wc_str(wxConvUTF8));
+ CreateActiveX((LPOLESTR) (const wchar_t *) progId.wc_str(wxConvUTF8));
}
wxActiveX::~wxActiveX()
};
m_connections.clear();
- if (m_oleInPlaceObject.Ok())
+ if (m_oleInPlaceObject.Ok())
{
m_oleInPlaceObject->InPlaceDeactivate();
m_oleInPlaceObject->UIDeactivate();
}
- if (m_oleObject.Ok())
+ if (m_oleObject.Ok())
{
if (m_docAdviseCookie != 0)
m_oleObject->Unadvise(m_docAdviseCookie);
GetTypeInfo();
// Get IOleObject interface
- hret = m_oleObject.QueryInterface(IID_IOleObject, m_ActiveX);
+ hret = m_oleObject.QueryInterface(IID_IOleObject, m_ActiveX);
wxASSERT(SUCCEEDED(hret));
- // Get IOleInPlaceObject interface
+
+ // document advise
+ m_docAdviseCookie = 0;
+ hret = m_oleObject->Advise(adviseSink, &m_docAdviseCookie);
+ WXOLE_WARN(hret, "m_oleObject->Advise(adviseSink, &m_docAdviseCookie),\"Advise\")");
+ m_oleObject->SetHostNames(L"wxActiveXContainer", NULL);
+ OleSetContainedObject(m_oleObject, TRUE);
+ OleRun(m_oleObject);
+
+
+ // Get IOleInPlaceObject interface
hret = m_oleInPlaceObject.QueryInterface(IID_IOleInPlaceObject, m_ActiveX);
wxASSERT(SUCCEEDED(hret));
WXOLE_WARN(hret, "CreateActiveX::pPersistStreamInit->InitNew()");
};
- // document advise
- m_docAdviseCookie = 0;
- hret = m_oleObject->Advise(adviseSink, &m_docAdviseCookie);
- WXOLE_WARN(hret, "m_oleObject->Advise(adviseSink, &m_docAdviseCookie),\"Advise\")");
- m_oleObject->SetHostNames(L"wxActiveXContainer", NULL);
- OleSetContainedObject(m_oleObject, TRUE);
-
if (! (dwMiscStatus & OLEMISC_SETCLIENTSITEFIRST))
m_oleObject->SetClientSite(m_clientSite);
posRect.bottom = h;
m_oleObjectHWND = 0;
- hret = m_oleInPlaceObject->GetWindow(&m_oleObjectHWND);
- WXOLE_WARN(hret, "m_oleInPlaceObject->GetWindow(&m_oleObjectHWND)");
- if (SUCCEEDED(hret))
- ::SetActiveWindow(m_oleObjectHWND);
+
+ if (m_oleInPlaceObject.Ok())
+ {
+ hret = m_oleInPlaceObject->GetWindow(&m_oleObjectHWND);
+ WXOLE_WARN(hret, "m_oleInPlaceObject->GetWindow(&m_oleObjectHWND)");
+ if (SUCCEEDED(hret))
+ ::SetActiveWindow(m_oleObjectHWND);
+ };
if (! (dwMiscStatus & OLEMISC_INVISIBLEATRUNTIME))
{
- if (w > 0 && h > 0)
+ if (w > 0 && h > 0 && m_oleInPlaceObject.Ok())
m_oleInPlaceObject->SetObjectRects(&posRect, &posRect);
hret = m_oleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, NULL, m_clientSite, 0, (HWND)GetHWND(), &posRect);
hret = m_oleObject->DoVerb(OLEIVERB_SHOW, 0, m_clientSite, 0, (HWND)GetHWND(), &posRect);
};
- if (! m_oleObjectHWND)
+ if (! m_oleObjectHWND && m_oleInPlaceObject.Ok())
{
hret = m_oleInPlaceObject->GetWindow(&m_oleObjectHWND);
WXOLE_WARN(hret, "m_oleInPlaceObject->GetWindow(&m_oleObjectHWND)");
static ActiveXEventMapFlusher s_dummyActiveXEventMapFlusher;
-const wxEventType& RegisterActiveXEvent(wxString eventName)
+const wxEventType& RegisterActiveXEvent(wxChar *eventName)
{
- ActiveXEventMap::iterator it = sg_eventMap.find(eventName);
+ wxString ev = eventName;
+ ActiveXEventMap::iterator it = sg_eventMap.find(ev);
if (it == sg_eventMap.end())
{
wxEventType *et = new wxEventType(wxNewEventType());
- sg_eventMap[eventName] = et;
+ sg_eventMap[ev] = et;
return *et;
};
public:
wxActiveXEvents(wxActiveX *ax) : m_activeX(ax) {}
- ~wxActiveXEvents()
+ ~wxActiveXEvents()
{
}
//IDispatch
STDMETHODIMP GetIDsOfNames(REFIID r, OLECHAR** o, unsigned int i, LCID l, DISPID* d)
- {
+ {
return E_NOTIMPL;
};
STDMETHODIMP GetTypeInfo(unsigned int i, LCID l, ITypeInfo** t)
- {
+ {
return E_NOTIMPL;
};
STDMETHODIMP GetTypeInfoCount(unsigned int* i)
- {
+ {
return E_NOTIMPL;
};
WORD wFlags, DISPPARAMS * pDispParams,
VARIANT * pVarResult, EXCEPINFO * pExcepInfo,
unsigned int * puArgErr)
- {
+ {
if (wFlags & (DISPATCH_PROPERTYGET | DISPATCH_PROPERTYPUT | DISPATCH_PROPERTYPUTREF))
return E_NOTIMPL;
int idx = mid->second;
-
+
wxActiveX::FuncX &func = m_activeX->m_events[idx];
ActiveXEventMap::iterator it = sg_eventMap.find(func.name);
if (px.IsOut())
{
wxVariant& vx = event.m_params[pDispParams->cArgs - i - 1];
-
+
VariantToMSWVariant(vx, va);
};
};
void wxActiveX::GetTypeInfo()
{
/*
- We are currently only interested in the IDispatch interface
+ We are currently only interested in the IDispatch interface
to the control. For dual interfaces (TypeKind = TKIND_INTERFACE)
- we should drill down through the inheritance
+ we should drill down through the inheritance
(using TYPEATTR->cImplTypes) and GetRefTypeOfImplType(n)
- and retrieve all the func names etc that way, then generate a C++
+ and retrieve all the func names etc that way, then generate a C++
header file for it.
- But we don't do this and probably never will, so if we have a DUAL
- interface then we query for the IDispatch
+ But we don't do this and probably never will, so if we have a DUAL
+ interface then we query for the IDispatch
via GetRefTypeOfImplType(-1).
*/
wxAutoOleInterface<IConnectionPointContainer> cpContainer(IID_IConnectionPointContainer, m_ActiveX);
if (! cpContainer.Ok())
return E_FAIL;
-
+
HRESULT hret = cpContainer->FindConnectionPoint(riid, cp.GetRef());
if (! SUCCEEDED(hret))
return hret;
-
+
hret = cp->Advise(events, &adviseCookie);
if (SUCCEEDED(hret))
if (w <= 0 && h <= 0)
return;
- if (m_oleInPlaceObject)
+ if (m_oleInPlaceObject.Ok())
m_oleInPlaceObject->SetObjectRects(&posRect, &posRect);
// extents are in HIMETRIC units
- SIZEL sz = {w, h};
- PixelsToHimetric(sz);
+ if (m_oleObject.Ok())
+ {
+ SIZEL sz = {w, h};
+ PixelsToHimetric(sz);
- SIZEL sz2;
- m_oleObject->GetExtent(DVASPECT_CONTENT, &sz2);
- if (sz2.cx != sz.cx || sz.cy != sz2.cy)
- m_oleObject->SetExtent(DVASPECT_CONTENT, &sz);
+ SIZEL sz2;
+
+ m_oleObject->GetExtent(DVASPECT_CONTENT, &sz2);
+ if (sz2.cx != sz.cx || sz.cy != sz2.cy)
+ m_oleObject->SetExtent(DVASPECT_CONTENT, &sz);
+ };
}
void wxActiveX::OnSetFocus(wxFocusEvent& event)
{
- if (m_oleInPlaceActiveObject.Ok())
+ if (m_oleInPlaceActiveObject.Ok())
m_oleInPlaceActiveObject->OnFrameWindowActivate(TRUE);
}
void wxActiveX::OnKillFocus(wxFocusEvent& event)
{
- if (m_oleInPlaceActiveObject.Ok())
+ if (m_oleInPlaceActiveObject.Ok())
m_oleInPlaceActiveObject->OnFrameWindowActivate(FALSE);
}
m_bAmbientShowHatching = true;
m_bAmbientShowGrabHandles = true;
m_bAmbientAppearance = true;
-
+
m_hDCBuffer = NULL;
m_hWndParent = (HWND)m_window->GetHWND();
}
HRESULT hr;
- if (pVarResult == NULL)
+ if (pVarResult == NULL)
return E_INVALIDARG;
//The most common case is boolean, use as an initial type
HRESULT FrameSite::GetWindow(HWND * phwnd)
{
WXOLE_TRACE("IOleWindow::GetWindow");
- if (phwnd == NULL)
+ if (phwnd == NULL)
return E_INVALIDARG;
(*phwnd) = m_hWndParent;
return S_OK;
HRESULT FrameSite::GetBorder(LPRECT lprectBorder)
{
WXOLE_TRACE("IOleInPlaceUIWindow::GetBorder");
- if (lprectBorder == NULL)
+ if (lprectBorder == NULL)
return E_INVALIDARG;
return INPLACE_E_NOTOOLSPACE;
}
HRESULT FrameSite::RequestBorderSpace(LPCBORDERWIDTHS pborderwidths)
{
WXOLE_TRACE("IOleInPlaceUIWindow::RequestBorderSpace");
- if (pborderwidths == NULL)
+ if (pborderwidths == NULL)
return E_INVALIDARG;
return INPLACE_E_NOTOOLSPACE;
}
if (ppFrame == NULL || ppDoc == NULL || lprcPosRect == NULL ||
lprcClipRect == NULL || lpFrameInfo == NULL)
{
- if (ppFrame != NULL)
+ if (ppFrame != NULL)
(*ppFrame) = NULL;
- if (ppDoc != NULL)
+ if (ppDoc != NULL)
(*ppDoc) = NULL;
return E_INVALIDARG;
}
{
WXOLE_TRACE("IOleInPlaceSiteEx::OnInPlaceActivateEx");
OleLockRunning(m_window->m_ActiveX, TRUE, FALSE);
- if (pfNoRedraw)
+ if (pfNoRedraw)
(*pfNoRedraw) = FALSE;
return S_OK;
}
HRESULT FrameSite::GetContainer(LPOLECONTAINER * ppContainer)
{
WXOLE_TRACE("IOleClientSite::GetContainer");
- if (ppContainer == NULL)
+ if (ppContainer == NULL)
return E_INVALIDARG;
-
+
HRESULT hr = QueryInterface(IID_IOleContainer, (void**)(ppContainer));
wxASSERT(SUCCEEDED(hr));
//IOleItemContainer
-HRESULT FrameSite::GetObject(LPOLESTR pszItem, DWORD dwSpeedNeeded,
+HRESULT FrameSite::GetObject(LPOLESTR pszItem, DWORD dwSpeedNeeded,
IBindCtx * pbc, REFIID riid, void ** ppvObject)
{
WXOLE_TRACE("IOleItemContainer::GetObject");
- if (pszItem == NULL)
+ if (pszItem == NULL)
return E_INVALIDARG;
- if (ppvObject == NULL)
+ if (ppvObject == NULL)
return E_INVALIDARG;
*ppvObject = NULL;
return MK_E_NOOBJECT;
}
-HRESULT FrameSite::GetObjectStorage(LPOLESTR pszItem, IBindCtx * pbc,
+HRESULT FrameSite::GetObjectStorage(LPOLESTR pszItem, IBindCtx * pbc,
REFIID riid, void ** ppvStorage)
{
WXOLE_TRACE("IOleItemContainer::GetObjectStorage");
- if (pszItem == NULL)
+ if (pszItem == NULL)
return E_INVALIDARG;
- if (ppvStorage == NULL)
+ if (ppvStorage == NULL)
return E_INVALIDARG;
*ppvStorage = NULL;
HRESULT FrameSite::IsRunning(LPOLESTR pszItem)
{
WXOLE_TRACE("IOleItemContainer::IsRunning");
- if (pszItem == NULL)
+ if (pszItem == NULL)
return E_INVALIDARG;
return MK_E_NOOBJECT;
//IOleCommandTarget
-HRESULT FrameSite::QueryStatus(const GUID * pguidCmdGroup, ULONG cCmds,
+HRESULT FrameSite::QueryStatus(const GUID * pguidCmdGroup, ULONG cCmds,
OLECMD * prgCmds, OLECMDTEXT * pCmdTet)
{
WXOLE_TRACE("IOleCommandTarget::QueryStatus");
return S_OK;
}
-HRESULT FrameSite::Exec(const GUID * pguidCmdGroup, DWORD nCmdID,
- DWORD nCmdExecOpt, VARIANTARG * pVaIn,
+HRESULT FrameSite::Exec(const GUID * pguidCmdGroup, DWORD nCmdID,
+ DWORD nCmdExecOpt, VARIANTARG * pVaIn,
VARIANTARG * pVaOut)
{
WXOLE_TRACE("IOleCommandTarget::Exec");
wxString GetIIDName(REFIID riid)
{
// an association between symbolic name and numeric value of an IID
- struct KNOWN_IID
+ struct KNOWN_IID
{
const IID *pIid;
const wxChar *szName;
#define ADD_KNOWN_IID(name) { &IID_I##name, _T(#name) }
#define ADD_KNOWN_GUID(name) { &name, _T(#name) }
- static const KNOWN_IID aKnownIids[] =
+ static const KNOWN_IID aKnownIids[] =
{
ADD_KNOWN_IID(AdviseSink),
ADD_KNOWN_IID(AdviseSink2),
#undef ADD_KNOWN_GUID
// try to find the interface in the table
- for ( size_t ui = 0; ui < WXSIZEOF(aKnownIids); ui++ )
+ for ( size_t ui = 0; ui < WXSIZEOF(aKnownIids); ui++ )
{
- if ( riid == *aKnownIids[ui].pIid )
+ if ( riid == *aKnownIids[ui].pIid )
{
return aKnownIids[ui].szName;
}