put unicode mods back in
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16136 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -35,23 +35,23 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
FS_DWebBrowserEvents2(wxIEHtmlWin *iewin) : m_iewin(iewin) {}
|
FS_DWebBrowserEvents2(wxIEHtmlWin *iewin) : m_iewin(iewin) {}
|
||||||
~FS_DWebBrowserEvents2()
|
~FS_DWebBrowserEvents2()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
//IDispatch
|
//IDispatch
|
||||||
STDMETHODIMP GetIDsOfNames(REFIID r, OLECHAR** o, unsigned int i, LCID l, DISPID* d)
|
STDMETHODIMP GetIDsOfNames(REFIID r, OLECHAR** o, unsigned int i, LCID l, DISPID* d)
|
||||||
{
|
{
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
};
|
};
|
||||||
|
|
||||||
STDMETHODIMP GetTypeInfo(unsigned int i, LCID l, ITypeInfo** t)
|
STDMETHODIMP GetTypeInfo(unsigned int i, LCID l, ITypeInfo** t)
|
||||||
{
|
{
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
};
|
};
|
||||||
|
|
||||||
STDMETHODIMP GetTypeInfoCount(unsigned int* i)
|
STDMETHODIMP GetTypeInfoCount(unsigned int* i)
|
||||||
{
|
{
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ public:
|
|||||||
WORD wFlags, DISPPARAMS * pDispParams,
|
WORD wFlags, DISPPARAMS * pDispParams,
|
||||||
VARIANT * pVarResult, EXCEPINFO * pExcepInfo,
|
VARIANT * pVarResult, EXCEPINFO * pExcepInfo,
|
||||||
unsigned int * puArgErr)
|
unsigned int * puArgErr)
|
||||||
{
|
{
|
||||||
if (wFlags & DISPATCH_PROPERTYGET)
|
if (wFlags & DISPATCH_PROPERTYGET)
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
|
|
||||||
@@ -123,21 +123,21 @@ public:
|
|||||||
case DISPID_BEFORENAVIGATE2:
|
case DISPID_BEFORENAVIGATE2:
|
||||||
if (Process(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, STR_ARG(5)))
|
if (Process(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, STR_ARG(5)))
|
||||||
*pDispParams->rgvarg->pboolVal = VARIANT_FALSE;
|
*pDispParams->rgvarg->pboolVal = VARIANT_FALSE;
|
||||||
else
|
else
|
||||||
*pDispParams->rgvarg->pboolVal = VARIANT_TRUE;
|
*pDispParams->rgvarg->pboolVal = VARIANT_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DISPID_NEWWINDOW2:
|
case DISPID_NEWWINDOW2:
|
||||||
if (Process(wxEVT_COMMAND_MSHTML_NEWWINDOW2))
|
if (Process(wxEVT_COMMAND_MSHTML_NEWWINDOW2))
|
||||||
*pDispParams->rgvarg->pboolVal = VARIANT_FALSE;
|
*pDispParams->rgvarg->pboolVal = VARIANT_FALSE;
|
||||||
else
|
else
|
||||||
*pDispParams->rgvarg->pboolVal = VARIANT_TRUE;
|
*pDispParams->rgvarg->pboolVal = VARIANT_TRUE;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DISPID_PROGRESSCHANGE:
|
case DISPID_PROGRESSCHANGE:
|
||||||
Post(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, "", LONG_ARG(1), LONG_ARG(0));
|
Post(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, "", LONG_ARG(1), LONG_ARG(0));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DISPID_DOCUMENTCOMPLETE:
|
case DISPID_DOCUMENTCOMPLETE:
|
||||||
Post(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, STR_ARG(0));
|
Post(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, STR_ARG(0));
|
||||||
break;
|
break;
|
||||||
@@ -181,7 +181,7 @@ wxIEHtmlWin::wxIEHtmlWin(wxWindow * parent, wxWindowID id,
|
|||||||
const wxPoint& pos,
|
const wxPoint& pos,
|
||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
long style,
|
long style,
|
||||||
const wxString& name) :
|
const wxString& name) :
|
||||||
wxActiveX(parent, PROGID, id, pos, size, style, name)
|
wxActiveX(parent, PROGID, id, pos, size, style, name)
|
||||||
{
|
{
|
||||||
SetupBrowser();
|
SetupBrowser();
|
||||||
@@ -242,7 +242,7 @@ void wxIEHtmlWin::SetCharset(wxString charset)
|
|||||||
{
|
{
|
||||||
wxAutoOleInterface<IHTMLDocument2> doc(IID_IHTMLDocument2, disp);
|
wxAutoOleInterface<IHTMLDocument2> doc(IID_IHTMLDocument2, disp);
|
||||||
if (doc.Ok())
|
if (doc.Ok())
|
||||||
doc->put_charset((BSTR) wxConvUTF8.cMB2WC(charset).data());
|
doc->put_charset((BSTR) (const wchar_t*)charset.wc_str(wxConvUTF8));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -284,12 +284,12 @@ private:
|
|||||||
istream *m_is;
|
istream *m_is;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
IStreamAdaptor(istream *is) : IStreamAdaptorBase(), m_is(is)
|
IStreamAdaptor(istream *is) : IStreamAdaptorBase(), m_is(is)
|
||||||
{
|
{
|
||||||
wxASSERT(m_is != NULL);
|
wxASSERT(m_is != NULL);
|
||||||
}
|
}
|
||||||
~IStreamAdaptor()
|
~IStreamAdaptor()
|
||||||
{
|
{
|
||||||
delete m_is;
|
delete m_is;
|
||||||
}
|
}
|
||||||
@@ -309,7 +309,7 @@ public:
|
|||||||
void wxIEHtmlWin::LoadUrl(const wxString& url)
|
void wxIEHtmlWin::LoadUrl(const wxString& url)
|
||||||
{
|
{
|
||||||
VARIANTARG navFlag, targetFrame, postData, headers;
|
VARIANTARG navFlag, targetFrame, postData, headers;
|
||||||
navFlag.vt = VT_EMPTY;
|
navFlag.vt = VT_EMPTY;
|
||||||
navFlag.vt = VT_I2;
|
navFlag.vt = VT_I2;
|
||||||
navFlag.iVal = navNoReadFromCache;
|
navFlag.iVal = navNoReadFromCache;
|
||||||
targetFrame.vt = VT_EMPTY;
|
targetFrame.vt = VT_EMPTY;
|
||||||
@@ -317,14 +317,14 @@ void wxIEHtmlWin::LoadUrl(const wxString& url)
|
|||||||
headers.vt = VT_EMPTY;
|
headers.vt = VT_EMPTY;
|
||||||
|
|
||||||
HRESULT hret = 0;
|
HRESULT hret = 0;
|
||||||
hret = m_webBrowser->Navigate((BSTR) wxConvUTF8.cMB2WC(url).data(),
|
hret = m_webBrowser->Navigate((BSTR) (const wchar_t*)url.wc_str(wxConvUTF8),
|
||||||
&navFlag, &targetFrame, &postData, &headers);
|
&navFlag, &targetFrame, &postData, &headers);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
bool wxIEHtmlWin::LoadString(wxString html)
|
bool wxIEHtmlWin::LoadString(wxString html)
|
||||||
{
|
{
|
||||||
string s = html.c_str();
|
string s = html.mb_str(wxConvUTF8);
|
||||||
istringstream *is = new istringstream(s);
|
istringstream *is = new istringstream(s);
|
||||||
return LoadStream(is);
|
return LoadStream(is);
|
||||||
};
|
};
|
||||||
@@ -466,7 +466,7 @@ wxString wxIEHtmlWin::GetStringSelection(bool asHTML)
|
|||||||
|
|
||||||
BSTR text = NULL;
|
BSTR text = NULL;
|
||||||
HRESULT hr = E_FAIL;
|
HRESULT hr = E_FAIL;
|
||||||
|
|
||||||
if (asHTML)
|
if (asHTML)
|
||||||
hr = tr->get_htmlText(&text);
|
hr = tr->get_htmlText(&text);
|
||||||
else
|
else
|
||||||
@@ -508,7 +508,7 @@ wxString wxIEHtmlWin::GetText(bool asHTML)
|
|||||||
// get inner text
|
// get inner text
|
||||||
BSTR text = NULL;
|
BSTR text = NULL;
|
||||||
hr = E_FAIL;
|
hr = E_FAIL;
|
||||||
|
|
||||||
if (asHTML)
|
if (asHTML)
|
||||||
hr = body->get_innerHTML(&text);
|
hr = body->get_innerHTML(&text);
|
||||||
else
|
else
|
||||||
@@ -519,5 +519,5 @@ wxString wxIEHtmlWin::GetText(bool asHTML)
|
|||||||
wxString s = text;
|
wxString s = text;
|
||||||
SysFreeString(text);
|
SysFreeString(text);
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
};
|
};
|
||||||
|
@@ -30,7 +30,14 @@ Source Files:
|
|||||||
|
|
||||||
Event Handling:
|
Event Handling:
|
||||||
---------------
|
---------------
|
||||||
- None currently
|
- EVT_ACTIVEX(id, eventName, handler) (handler = void OnActiveX(wxActiveXEvent& event))
|
||||||
|
class wxActiveXEvent : public wxNotifyEvent
|
||||||
|
int ParamCount() const;
|
||||||
|
wxVariant operator[] (int idx) const; // parameter by index
|
||||||
|
wxVariant& operator[] (int idx);
|
||||||
|
wxVariant operator[] (wxString name) const; // named parameters
|
||||||
|
wxVariant& operator[] (wxString name);
|
||||||
|
|
||||||
|
|
||||||
Members:
|
Members:
|
||||||
--------
|
--------
|
||||||
@@ -60,6 +67,19 @@ e.g.
|
|||||||
delete events;
|
delete events;
|
||||||
|
|
||||||
|
|
||||||
|
Sample Events:
|
||||||
|
--------------
|
||||||
|
EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X)
|
||||||
|
|
||||||
|
void wxIEFrame::OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event)
|
||||||
|
{
|
||||||
|
wxString url = event["Url"];
|
||||||
|
|
||||||
|
int rc = wxMessageBox(url, "Allow open url ?", wxYES_NO);
|
||||||
|
|
||||||
|
if (rc != wxYES)
|
||||||
|
event["Cancel"] = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
wxIEHtmlWin:
|
wxIEHtmlWin:
|
||||||
|
@@ -31,7 +31,7 @@ END_EVENT_TABLE()
|
|||||||
|
|
||||||
class wxActiveX;
|
class wxActiveX;
|
||||||
|
|
||||||
class FrameSite :
|
class FrameSite :
|
||||||
public IOleClientSite,
|
public IOleClientSite,
|
||||||
public IOleInPlaceSiteEx,
|
public IOleInPlaceSiteEx,
|
||||||
public IOleInPlaceFrame,
|
public IOleInPlaceFrame,
|
||||||
@@ -58,7 +58,7 @@ public:
|
|||||||
STDMETHODIMP RequestBorderSpace(LPCBORDERWIDTHS);
|
STDMETHODIMP RequestBorderSpace(LPCBORDERWIDTHS);
|
||||||
STDMETHODIMP SetBorderSpace(LPCBORDERWIDTHS);
|
STDMETHODIMP SetBorderSpace(LPCBORDERWIDTHS);
|
||||||
STDMETHODIMP SetActiveObject(IOleInPlaceActiveObject*, LPCOLESTR);
|
STDMETHODIMP SetActiveObject(IOleInPlaceActiveObject*, LPCOLESTR);
|
||||||
|
|
||||||
//IOleInPlaceFrame
|
//IOleInPlaceFrame
|
||||||
STDMETHODIMP InsertMenus(HMENU, LPOLEMENUGROUPWIDTHS);
|
STDMETHODIMP InsertMenus(HMENU, LPOLEMENUGROUPWIDTHS);
|
||||||
STDMETHODIMP SetMenu(HMENU, HOLEMENU, HWND);
|
STDMETHODIMP SetMenu(HMENU, HOLEMENU, HWND);
|
||||||
@@ -71,7 +71,7 @@ public:
|
|||||||
STDMETHODIMP CanInPlaceActivate();
|
STDMETHODIMP CanInPlaceActivate();
|
||||||
STDMETHODIMP OnInPlaceActivate();
|
STDMETHODIMP OnInPlaceActivate();
|
||||||
STDMETHODIMP OnUIActivate();
|
STDMETHODIMP OnUIActivate();
|
||||||
STDMETHODIMP GetWindowContext(IOleInPlaceFrame**, IOleInPlaceUIWindow**,
|
STDMETHODIMP GetWindowContext(IOleInPlaceFrame**, IOleInPlaceUIWindow**,
|
||||||
LPRECT, LPRECT, LPOLEINPLACEFRAMEINFO);
|
LPRECT, LPRECT, LPOLEINPLACEFRAMEINFO);
|
||||||
STDMETHODIMP Scroll(SIZE);
|
STDMETHODIMP Scroll(SIZE);
|
||||||
STDMETHODIMP OnUIDeactivate(BOOL);
|
STDMETHODIMP OnUIDeactivate(BOOL);
|
||||||
@@ -117,7 +117,7 @@ public:
|
|||||||
STDMETHODIMP GetObject(LPOLESTR, DWORD, IBindCtx*, REFIID, void**);
|
STDMETHODIMP GetObject(LPOLESTR, DWORD, IBindCtx*, REFIID, void**);
|
||||||
STDMETHODIMP GetObjectStorage(LPOLESTR, IBindCtx*, REFIID, void**);
|
STDMETHODIMP GetObjectStorage(LPOLESTR, IBindCtx*, REFIID, void**);
|
||||||
STDMETHODIMP IsRunning(LPOLESTR);
|
STDMETHODIMP IsRunning(LPOLESTR);
|
||||||
|
|
||||||
//IDispatch
|
//IDispatch
|
||||||
STDMETHODIMP GetIDsOfNames(REFIID, OLECHAR**, unsigned int, LCID, DISPID*);
|
STDMETHODIMP GetIDsOfNames(REFIID, OLECHAR**, unsigned int, LCID, DISPID*);
|
||||||
STDMETHODIMP GetTypeInfo(unsigned int, LCID, ITypeInfo**);
|
STDMETHODIMP GetTypeInfo(unsigned int, LCID, ITypeInfo**);
|
||||||
@@ -146,7 +146,7 @@ protected:
|
|||||||
bool m_bInPlaceActive;
|
bool m_bInPlaceActive;
|
||||||
bool m_bUIActive;
|
bool m_bUIActive;
|
||||||
bool m_bWindowless;
|
bool m_bWindowless;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LCID m_nAmbientLocale;
|
LCID m_nAmbientLocale;
|
||||||
@@ -207,7 +207,7 @@ wxActiveX::wxActiveX(wxWindow * parent, wxString progId, wxWindowID id,
|
|||||||
{
|
{
|
||||||
m_bAmbientUserMode = true;
|
m_bAmbientUserMode = true;
|
||||||
m_docAdviseCookie = 0;
|
m_docAdviseCookie = 0;
|
||||||
CreateActiveX((LPOLESTR) wxConvUTF8.cMB2WC(progId).data());
|
CreateActiveX((LPOLESTR) (const wchar_t*)progId.wc_str(wxConvUTF8));
|
||||||
}
|
}
|
||||||
|
|
||||||
wxActiveX::~wxActiveX()
|
wxActiveX::~wxActiveX()
|
||||||
@@ -223,14 +223,14 @@ wxActiveX::~wxActiveX()
|
|||||||
};
|
};
|
||||||
m_connections.clear();
|
m_connections.clear();
|
||||||
|
|
||||||
if (m_oleInPlaceObject.Ok())
|
if (m_oleInPlaceObject.Ok())
|
||||||
{
|
{
|
||||||
m_oleInPlaceObject->InPlaceDeactivate();
|
m_oleInPlaceObject->InPlaceDeactivate();
|
||||||
m_oleInPlaceObject->UIDeactivate();
|
m_oleInPlaceObject->UIDeactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (m_oleObject.Ok())
|
if (m_oleObject.Ok())
|
||||||
{
|
{
|
||||||
if (m_docAdviseCookie != 0)
|
if (m_docAdviseCookie != 0)
|
||||||
m_oleObject->Unadvise(m_docAdviseCookie);
|
m_oleObject->Unadvise(m_docAdviseCookie);
|
||||||
@@ -266,7 +266,7 @@ void wxActiveX::CreateActiveX(REFCLSID clsid)
|
|||||||
GetTypeInfo();
|
GetTypeInfo();
|
||||||
|
|
||||||
// Get IOleObject interface
|
// Get IOleObject interface
|
||||||
hret = m_oleObject.QueryInterface(IID_IOleObject, m_ActiveX);
|
hret = m_oleObject.QueryInterface(IID_IOleObject, m_ActiveX);
|
||||||
wxASSERT(SUCCEEDED(hret));
|
wxASSERT(SUCCEEDED(hret));
|
||||||
// Get IOleInPlaceObject interface
|
// Get IOleInPlaceObject interface
|
||||||
hret = m_oleInPlaceObject.QueryInterface(IID_IOleInPlaceObject, m_ActiveX);
|
hret = m_oleInPlaceObject.QueryInterface(IID_IOleInPlaceObject, m_ActiveX);
|
||||||
@@ -479,23 +479,23 @@ private:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
wxActiveXEvents(wxActiveX *ax) : m_activeX(ax) {}
|
wxActiveXEvents(wxActiveX *ax) : m_activeX(ax) {}
|
||||||
~wxActiveXEvents()
|
~wxActiveXEvents()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
//IDispatch
|
//IDispatch
|
||||||
STDMETHODIMP GetIDsOfNames(REFIID r, OLECHAR** o, unsigned int i, LCID l, DISPID* d)
|
STDMETHODIMP GetIDsOfNames(REFIID r, OLECHAR** o, unsigned int i, LCID l, DISPID* d)
|
||||||
{
|
{
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
};
|
};
|
||||||
|
|
||||||
STDMETHODIMP GetTypeInfo(unsigned int i, LCID l, ITypeInfo** t)
|
STDMETHODIMP GetTypeInfo(unsigned int i, LCID l, ITypeInfo** t)
|
||||||
{
|
{
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
};
|
};
|
||||||
|
|
||||||
STDMETHODIMP GetTypeInfoCount(unsigned int* i)
|
STDMETHODIMP GetTypeInfoCount(unsigned int* i)
|
||||||
{
|
{
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -505,7 +505,7 @@ public:
|
|||||||
WORD wFlags, DISPPARAMS * pDispParams,
|
WORD wFlags, DISPPARAMS * pDispParams,
|
||||||
VARIANT * pVarResult, EXCEPINFO * pExcepInfo,
|
VARIANT * pVarResult, EXCEPINFO * pExcepInfo,
|
||||||
unsigned int * puArgErr)
|
unsigned int * puArgErr)
|
||||||
{
|
{
|
||||||
if (wFlags & (DISPATCH_PROPERTYGET | DISPATCH_PROPERTYPUT | DISPATCH_PROPERTYPUTREF))
|
if (wFlags & (DISPATCH_PROPERTYGET | DISPATCH_PROPERTYPUT | DISPATCH_PROPERTYPUTREF))
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
|
|
||||||
@@ -516,7 +516,7 @@ public:
|
|||||||
|
|
||||||
int idx = mid->second;
|
int idx = mid->second;
|
||||||
|
|
||||||
|
|
||||||
wxActiveX::FuncX &func = m_activeX->m_events[idx];
|
wxActiveX::FuncX &func = m_activeX->m_events[idx];
|
||||||
|
|
||||||
ActiveXEventMap::iterator it = sg_eventMap.find(func.name);
|
ActiveXEventMap::iterator it = sg_eventMap.find(func.name);
|
||||||
@@ -555,7 +555,7 @@ public:
|
|||||||
if (px.IsOut())
|
if (px.IsOut())
|
||||||
{
|
{
|
||||||
wxVariant& vx = event.m_params[pDispParams->cArgs - i - 1];
|
wxVariant& vx = event.m_params[pDispParams->cArgs - i - 1];
|
||||||
|
|
||||||
VariantToMSWVariant(vx, va);
|
VariantToMSWVariant(vx, va);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -622,15 +622,15 @@ wxVariant& wxActiveXEvent::operator[] (wxString name)
|
|||||||
void wxActiveX::GetTypeInfo()
|
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)
|
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)
|
(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.
|
header file for it.
|
||||||
|
|
||||||
But we don't do this and probably never will, so if we have a DUAL
|
But we don't do this and probably never will, so if we have a DUAL
|
||||||
interface then we query for the IDispatch
|
interface then we query for the IDispatch
|
||||||
via GetRefTypeOfImplType(-1).
|
via GetRefTypeOfImplType(-1).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -792,11 +792,11 @@ HRESULT wxActiveX::ConnectAdvise(REFIID riid, IUnknown *events)
|
|||||||
wxAutoOleInterface<IConnectionPointContainer> cpContainer(IID_IConnectionPointContainer, m_ActiveX);
|
wxAutoOleInterface<IConnectionPointContainer> cpContainer(IID_IConnectionPointContainer, m_ActiveX);
|
||||||
if (! cpContainer.Ok())
|
if (! cpContainer.Ok())
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
HRESULT hret = cpContainer->FindConnectionPoint(riid, cp.GetRef());
|
HRESULT hret = cpContainer->FindConnectionPoint(riid, cp.GetRef());
|
||||||
if (! SUCCEEDED(hret))
|
if (! SUCCEEDED(hret))
|
||||||
return hret;
|
return hret;
|
||||||
|
|
||||||
hret = cp->Advise(events, &adviseCookie);
|
hret = cp->Advise(events, &adviseCookie);
|
||||||
|
|
||||||
if (SUCCEEDED(hret))
|
if (SUCCEEDED(hret))
|
||||||
@@ -857,7 +857,7 @@ void wxActiveX::OnSize(wxSizeEvent& event)
|
|||||||
if (w <= 0 && h <= 0)
|
if (w <= 0 && h <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_oleInPlaceObject)
|
if (m_oleInPlaceObject)
|
||||||
m_oleInPlaceObject->SetObjectRects(&posRect, &posRect);
|
m_oleInPlaceObject->SetObjectRects(&posRect, &posRect);
|
||||||
|
|
||||||
// extents are in HIMETRIC units
|
// extents are in HIMETRIC units
|
||||||
@@ -872,13 +872,13 @@ void wxActiveX::OnSize(wxSizeEvent& event)
|
|||||||
|
|
||||||
void wxActiveX::OnSetFocus(wxFocusEvent& event)
|
void wxActiveX::OnSetFocus(wxFocusEvent& event)
|
||||||
{
|
{
|
||||||
if (m_oleInPlaceActiveObject.Ok())
|
if (m_oleInPlaceActiveObject.Ok())
|
||||||
m_oleInPlaceActiveObject->OnFrameWindowActivate(TRUE);
|
m_oleInPlaceActiveObject->OnFrameWindowActivate(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxActiveX::OnKillFocus(wxFocusEvent& event)
|
void wxActiveX::OnKillFocus(wxFocusEvent& event)
|
||||||
{
|
{
|
||||||
if (m_oleInPlaceActiveObject.Ok())
|
if (m_oleInPlaceActiveObject.Ok())
|
||||||
m_oleInPlaceActiveObject->OnFrameWindowActivate(FALSE);
|
m_oleInPlaceActiveObject->OnFrameWindowActivate(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -898,7 +898,7 @@ FrameSite::FrameSite(wxActiveX * win)
|
|||||||
m_bAmbientShowHatching = true;
|
m_bAmbientShowHatching = true;
|
||||||
m_bAmbientShowGrabHandles = true;
|
m_bAmbientShowGrabHandles = true;
|
||||||
m_bAmbientAppearance = true;
|
m_bAmbientAppearance = true;
|
||||||
|
|
||||||
m_hDCBuffer = NULL;
|
m_hDCBuffer = NULL;
|
||||||
m_hWndParent = (HWND)m_window->GetHWND();
|
m_hWndParent = (HWND)m_window->GetHWND();
|
||||||
}
|
}
|
||||||
@@ -941,7 +941,7 @@ HRESULT FrameSite::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid,
|
|||||||
|
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
if (pVarResult == NULL)
|
if (pVarResult == NULL)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
//The most common case is boolean, use as an initial type
|
//The most common case is boolean, use as an initial type
|
||||||
@@ -1017,7 +1017,7 @@ HRESULT FrameSite::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid,
|
|||||||
HRESULT FrameSite::GetWindow(HWND * phwnd)
|
HRESULT FrameSite::GetWindow(HWND * phwnd)
|
||||||
{
|
{
|
||||||
WXOLE_TRACE("IOleWindow::GetWindow");
|
WXOLE_TRACE("IOleWindow::GetWindow");
|
||||||
if (phwnd == NULL)
|
if (phwnd == NULL)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
(*phwnd) = m_hWndParent;
|
(*phwnd) = m_hWndParent;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
@@ -1034,7 +1034,7 @@ HRESULT FrameSite::ContextSensitiveHelp(BOOL fEnterMode)
|
|||||||
HRESULT FrameSite::GetBorder(LPRECT lprectBorder)
|
HRESULT FrameSite::GetBorder(LPRECT lprectBorder)
|
||||||
{
|
{
|
||||||
WXOLE_TRACE("IOleInPlaceUIWindow::GetBorder");
|
WXOLE_TRACE("IOleInPlaceUIWindow::GetBorder");
|
||||||
if (lprectBorder == NULL)
|
if (lprectBorder == NULL)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
return INPLACE_E_NOTOOLSPACE;
|
return INPLACE_E_NOTOOLSPACE;
|
||||||
}
|
}
|
||||||
@@ -1042,7 +1042,7 @@ HRESULT FrameSite::GetBorder(LPRECT lprectBorder)
|
|||||||
HRESULT FrameSite::RequestBorderSpace(LPCBORDERWIDTHS pborderwidths)
|
HRESULT FrameSite::RequestBorderSpace(LPCBORDERWIDTHS pborderwidths)
|
||||||
{
|
{
|
||||||
WXOLE_TRACE("IOleInPlaceUIWindow::RequestBorderSpace");
|
WXOLE_TRACE("IOleInPlaceUIWindow::RequestBorderSpace");
|
||||||
if (pborderwidths == NULL)
|
if (pborderwidths == NULL)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
return INPLACE_E_NOTOOLSPACE;
|
return INPLACE_E_NOTOOLSPACE;
|
||||||
}
|
}
|
||||||
@@ -1139,9 +1139,9 @@ HRESULT FrameSite::GetWindowContext(IOleInPlaceFrame **ppFrame,
|
|||||||
if (ppFrame == NULL || ppDoc == NULL || lprcPosRect == NULL ||
|
if (ppFrame == NULL || ppDoc == NULL || lprcPosRect == NULL ||
|
||||||
lprcClipRect == NULL || lpFrameInfo == NULL)
|
lprcClipRect == NULL || lpFrameInfo == NULL)
|
||||||
{
|
{
|
||||||
if (ppFrame != NULL)
|
if (ppFrame != NULL)
|
||||||
(*ppFrame) = NULL;
|
(*ppFrame) = NULL;
|
||||||
if (ppDoc != NULL)
|
if (ppDoc != NULL)
|
||||||
(*ppDoc) = NULL;
|
(*ppDoc) = NULL;
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
}
|
}
|
||||||
@@ -1231,7 +1231,7 @@ HRESULT FrameSite::OnInPlaceActivateEx(BOOL * pfNoRedraw, DWORD dwFlags)
|
|||||||
{
|
{
|
||||||
WXOLE_TRACE("IOleInPlaceSiteEx::OnInPlaceActivateEx");
|
WXOLE_TRACE("IOleInPlaceSiteEx::OnInPlaceActivateEx");
|
||||||
OleLockRunning(m_window->m_ActiveX, TRUE, FALSE);
|
OleLockRunning(m_window->m_ActiveX, TRUE, FALSE);
|
||||||
if (pfNoRedraw)
|
if (pfNoRedraw)
|
||||||
(*pfNoRedraw) = FALSE;
|
(*pfNoRedraw) = FALSE;
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
@@ -1268,9 +1268,9 @@ HRESULT FrameSite::GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker,
|
|||||||
HRESULT FrameSite::GetContainer(LPOLECONTAINER * ppContainer)
|
HRESULT FrameSite::GetContainer(LPOLECONTAINER * ppContainer)
|
||||||
{
|
{
|
||||||
WXOLE_TRACE("IOleClientSite::GetContainer");
|
WXOLE_TRACE("IOleClientSite::GetContainer");
|
||||||
if (ppContainer == NULL)
|
if (ppContainer == NULL)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
HRESULT hr = QueryInterface(IID_IOleContainer, (void**)(ppContainer));
|
HRESULT hr = QueryInterface(IID_IOleContainer, (void**)(ppContainer));
|
||||||
wxASSERT(SUCCEEDED(hr));
|
wxASSERT(SUCCEEDED(hr));
|
||||||
|
|
||||||
@@ -1323,26 +1323,26 @@ HRESULT FrameSite::LockContainer(BOOL fLock)
|
|||||||
|
|
||||||
//IOleItemContainer
|
//IOleItemContainer
|
||||||
|
|
||||||
HRESULT FrameSite::GetObject(LPOLESTR pszItem, DWORD dwSpeedNeeded,
|
HRESULT FrameSite::GetObject(LPOLESTR pszItem, DWORD dwSpeedNeeded,
|
||||||
IBindCtx * pbc, REFIID riid, void ** ppvObject)
|
IBindCtx * pbc, REFIID riid, void ** ppvObject)
|
||||||
{
|
{
|
||||||
WXOLE_TRACE("IOleItemContainer::GetObject");
|
WXOLE_TRACE("IOleItemContainer::GetObject");
|
||||||
if (pszItem == NULL)
|
if (pszItem == NULL)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
if (ppvObject == NULL)
|
if (ppvObject == NULL)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
*ppvObject = NULL;
|
*ppvObject = NULL;
|
||||||
return MK_E_NOOBJECT;
|
return MK_E_NOOBJECT;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT FrameSite::GetObjectStorage(LPOLESTR pszItem, IBindCtx * pbc,
|
HRESULT FrameSite::GetObjectStorage(LPOLESTR pszItem, IBindCtx * pbc,
|
||||||
REFIID riid, void ** ppvStorage)
|
REFIID riid, void ** ppvStorage)
|
||||||
{
|
{
|
||||||
WXOLE_TRACE("IOleItemContainer::GetObjectStorage");
|
WXOLE_TRACE("IOleItemContainer::GetObjectStorage");
|
||||||
if (pszItem == NULL)
|
if (pszItem == NULL)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
if (ppvStorage == NULL)
|
if (ppvStorage == NULL)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
*ppvStorage = NULL;
|
*ppvStorage = NULL;
|
||||||
@@ -1352,7 +1352,7 @@ HRESULT FrameSite::GetObjectStorage(LPOLESTR pszItem, IBindCtx * pbc,
|
|||||||
HRESULT FrameSite::IsRunning(LPOLESTR pszItem)
|
HRESULT FrameSite::IsRunning(LPOLESTR pszItem)
|
||||||
{
|
{
|
||||||
WXOLE_TRACE("IOleItemContainer::IsRunning");
|
WXOLE_TRACE("IOleItemContainer::IsRunning");
|
||||||
if (pszItem == NULL)
|
if (pszItem == NULL)
|
||||||
return E_INVALIDARG;
|
return E_INVALIDARG;
|
||||||
|
|
||||||
return MK_E_NOOBJECT;
|
return MK_E_NOOBJECT;
|
||||||
@@ -1417,7 +1417,7 @@ HRESULT FrameSite::ShowPropertyFrame()
|
|||||||
|
|
||||||
//IOleCommandTarget
|
//IOleCommandTarget
|
||||||
|
|
||||||
HRESULT FrameSite::QueryStatus(const GUID * pguidCmdGroup, ULONG cCmds,
|
HRESULT FrameSite::QueryStatus(const GUID * pguidCmdGroup, ULONG cCmds,
|
||||||
OLECMD * prgCmds, OLECMDTEXT * pCmdTet)
|
OLECMD * prgCmds, OLECMDTEXT * pCmdTet)
|
||||||
{
|
{
|
||||||
WXOLE_TRACE("IOleCommandTarget::QueryStatus");
|
WXOLE_TRACE("IOleCommandTarget::QueryStatus");
|
||||||
@@ -1436,8 +1436,8 @@ HRESULT FrameSite::QueryStatus(const GUID * pguidCmdGroup, ULONG cCmds,
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT FrameSite::Exec(const GUID * pguidCmdGroup, DWORD nCmdID,
|
HRESULT FrameSite::Exec(const GUID * pguidCmdGroup, DWORD nCmdID,
|
||||||
DWORD nCmdExecOpt, VARIANTARG * pVaIn,
|
DWORD nCmdExecOpt, VARIANTARG * pVaIn,
|
||||||
VARIANTARG * pVaOut)
|
VARIANTARG * pVaOut)
|
||||||
{
|
{
|
||||||
WXOLE_TRACE("IOleCommandTarget::Exec");
|
WXOLE_TRACE("IOleCommandTarget::Exec");
|
||||||
@@ -1592,7 +1592,7 @@ wxString OLEHResultToString(HRESULT hr)
|
|||||||
wxString GetIIDName(REFIID riid)
|
wxString GetIIDName(REFIID riid)
|
||||||
{
|
{
|
||||||
// an association between symbolic name and numeric value of an IID
|
// an association between symbolic name and numeric value of an IID
|
||||||
struct KNOWN_IID
|
struct KNOWN_IID
|
||||||
{
|
{
|
||||||
const IID *pIid;
|
const IID *pIid;
|
||||||
const wxChar *szName;
|
const wxChar *szName;
|
||||||
@@ -1602,7 +1602,7 @@ wxString GetIIDName(REFIID riid)
|
|||||||
#define ADD_KNOWN_IID(name) { &IID_I##name, _T(#name) }
|
#define ADD_KNOWN_IID(name) { &IID_I##name, _T(#name) }
|
||||||
#define ADD_KNOWN_GUID(name) { &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(AdviseSink),
|
||||||
ADD_KNOWN_IID(AdviseSink2),
|
ADD_KNOWN_IID(AdviseSink2),
|
||||||
@@ -1696,9 +1696,9 @@ wxString GetIIDName(REFIID riid)
|
|||||||
#undef ADD_KNOWN_GUID
|
#undef ADD_KNOWN_GUID
|
||||||
|
|
||||||
// try to find the interface in the table
|
// 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;
|
return aKnownIids[ui].szName;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user