Added support for DWebBrowserEvents2 to control, regenerated proxy event firing header and implemented a few more methods

This commit is contained in:
locka%iol.ie 1998-10-18 22:14:47 +00:00
Родитель c760323fb1
Коммит 0350089250
8 изменённых файлов: 769 добавлений и 38 удалений

Просмотреть файл

@ -450,3 +450,460 @@ public:
}; };
//////////////////////////////////////////////////////////////////////////////
// CProxyDWebBrowserEvents2
template <class T>
class CProxyDWebBrowserEvents2 : public IConnectionPointImpl<T, &DIID_DWebBrowserEvents2, CComDynamicUnkArray>
{
public:
//methods:
//DWebBrowserEvents2 : IDispatch
public:
void Fire_StatusTextChange(
BSTR Text)
{
VARIANTARG* pvars = new VARIANTARG[1];
for (int i = 0; i < 1; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[0].vt = VT_BSTR;
pvars[0].bstrVal= Text;
DISPPARAMS disp = { pvars, NULL, 1, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0x66, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
void Fire_ProgressChange(
long Progress,
long ProgressMax)
{
VARIANTARG* pvars = new VARIANTARG[2];
for (int i = 0; i < 2; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[1].vt = VT_I4;
pvars[1].lVal= Progress;
pvars[0].vt = VT_I4;
pvars[0].lVal= ProgressMax;
DISPPARAMS disp = { pvars, NULL, 2, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0x6c, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
void Fire_CommandStateChange(
long Command,
VARIANT_BOOL Enable)
{
VARIANTARG* pvars = new VARIANTARG[2];
for (int i = 0; i < 2; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[1].vt = VT_I4;
pvars[1].lVal= Command;
pvars[0].vt = VT_BOOL;
pvars[0].boolVal= Enable;
DISPPARAMS disp = { pvars, NULL, 2, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0x69, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
void Fire_DownloadBegin()
{
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
DISPPARAMS disp = { NULL, NULL, 0, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0x6a, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
}
void Fire_DownloadComplete()
{
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
DISPPARAMS disp = { NULL, NULL, 0, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0x68, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
}
void Fire_TitleChange(
BSTR Text)
{
VARIANTARG* pvars = new VARIANTARG[1];
for (int i = 0; i < 1; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[0].vt = VT_BSTR;
pvars[0].bstrVal= Text;
DISPPARAMS disp = { pvars, NULL, 1, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0x71, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
void Fire_PropertyChange(
BSTR szProperty)
{
VARIANTARG* pvars = new VARIANTARG[1];
for (int i = 0; i < 1; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[0].vt = VT_BSTR;
pvars[0].bstrVal= szProperty;
DISPPARAMS disp = { pvars, NULL, 1, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0x70, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
void Fire_BeforeNavigate2(
IDispatch * pDisp,
VARIANT * URL,
VARIANT * Flags,
VARIANT * TargetFrameName,
VARIANT * PostData,
VARIANT * Headers,
VARIANT_BOOL * Cancel)
{
VARIANTARG* pvars = new VARIANTARG[7];
for (int i = 0; i < 7; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[6].vt = VT_DISPATCH;
pvars[6].pdispVal= pDisp;
pvars[5].vt = VT_VARIANT | VT_BYREF;
pvars[5].byref= URL;
pvars[4].vt = VT_VARIANT | VT_BYREF;
pvars[4].byref= Flags;
pvars[3].vt = VT_VARIANT | VT_BYREF;
pvars[3].byref= TargetFrameName;
pvars[2].vt = VT_VARIANT | VT_BYREF;
pvars[2].byref= PostData;
pvars[1].vt = VT_VARIANT | VT_BYREF;
pvars[1].byref= Headers;
pvars[0].vt = VT_BOOL | VT_BYREF;
pvars[0].byref= Cancel;
DISPPARAMS disp = { pvars, NULL, 7, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0xfa, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
void Fire_NewWindow2(
IDispatch * * ppDisp,
VARIANT_BOOL * Cancel)
{
VARIANTARG* pvars = new VARIANTARG[2];
for (int i = 0; i < 2; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[1].vt = VT_DISPATCH | VT_BYREF;
pvars[1].byref= ppDisp;
pvars[0].vt = VT_BOOL | VT_BYREF;
pvars[0].byref= Cancel;
DISPPARAMS disp = { pvars, NULL, 2, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0xfb, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
void Fire_NavigateComplete2(
IDispatch * pDisp,
VARIANT * URL)
{
VARIANTARG* pvars = new VARIANTARG[2];
for (int i = 0; i < 2; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[1].vt = VT_DISPATCH;
pvars[1].pdispVal= pDisp;
pvars[0].vt = VT_VARIANT | VT_BYREF;
pvars[0].byref= URL;
DISPPARAMS disp = { pvars, NULL, 2, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0xfc, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
void Fire_DocumentComplete(
IDispatch * pDisp,
VARIANT * URL)
{
VARIANTARG* pvars = new VARIANTARG[2];
for (int i = 0; i < 2; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[1].vt = VT_DISPATCH;
pvars[1].pdispVal= pDisp;
pvars[0].vt = VT_VARIANT | VT_BYREF;
pvars[0].byref= URL;
DISPPARAMS disp = { pvars, NULL, 2, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0x103, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
void Fire_OnQuit()
{
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
DISPPARAMS disp = { NULL, NULL, 0, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0xfd, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
}
void Fire_OnVisible(
VARIANT_BOOL Visible)
{
VARIANTARG* pvars = new VARIANTARG[1];
for (int i = 0; i < 1; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[0].vt = VT_BOOL;
pvars[0].boolVal= Visible;
DISPPARAMS disp = { pvars, NULL, 1, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0xfe, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
void Fire_OnToolBar(
VARIANT_BOOL ToolBar)
{
VARIANTARG* pvars = new VARIANTARG[1];
for (int i = 0; i < 1; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[0].vt = VT_BOOL;
pvars[0].boolVal= ToolBar;
DISPPARAMS disp = { pvars, NULL, 1, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0xff, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
void Fire_OnMenuBar(
VARIANT_BOOL MenuBar)
{
VARIANTARG* pvars = new VARIANTARG[1];
for (int i = 0; i < 1; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[0].vt = VT_BOOL;
pvars[0].boolVal= MenuBar;
DISPPARAMS disp = { pvars, NULL, 1, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0x100, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
void Fire_OnStatusBar(
VARIANT_BOOL StatusBar)
{
VARIANTARG* pvars = new VARIANTARG[1];
for (int i = 0; i < 1; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[0].vt = VT_BOOL;
pvars[0].boolVal= StatusBar;
DISPPARAMS disp = { pvars, NULL, 1, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0x101, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
void Fire_OnFullScreen(
VARIANT_BOOL FullScreen)
{
VARIANTARG* pvars = new VARIANTARG[1];
for (int i = 0; i < 1; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[0].vt = VT_BOOL;
pvars[0].boolVal= FullScreen;
DISPPARAMS disp = { pvars, NULL, 1, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0x102, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
void Fire_OnTheaterMode(
VARIANT_BOOL TheaterMode)
{
VARIANTARG* pvars = new VARIANTARG[1];
for (int i = 0; i < 1; i++)
VariantInit(&pvars[i]);
T* pT = (T*)this;
pT->Lock();
IUnknown** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
pvars[0].vt = VT_BOOL;
pvars[0].boolVal= TheaterMode;
DISPPARAMS disp = { pvars, NULL, 1, 0 };
IDispatch* pDispatch = reinterpret_cast<IDispatch*>(*pp);
pDispatch->Invoke(0x104, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &disp, NULL, NULL, NULL);
}
pp++;
}
pT->Unlock();
delete[] pvars;
}
};

Просмотреть файл

@ -756,6 +756,12 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Busy(VARIANT_BOOL __RPC_FAR *pBoo
HRESULT STDMETHODCALLTYPE CMozillaBrowser::Quit(void) HRESULT STDMETHODCALLTYPE CMozillaBrowser::Quit(void)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
// TODO fire quit event // TODO fire quit event
return S_OK; return S_OK;
} }
@ -763,6 +769,12 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::Quit(void)
HRESULT STDMETHODCALLTYPE CMozillaBrowser::ClientToWindow(int __RPC_FAR *pcx, int __RPC_FAR *pcy) HRESULT STDMETHODCALLTYPE CMozillaBrowser::ClientToWindow(int __RPC_FAR *pcx, int __RPC_FAR *pcy)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
// TODO convert points to be relative to browser // TODO convert points to be relative to browser
return S_OK; return S_OK;
} }
@ -770,6 +782,12 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::ClientToWindow(int __RPC_FAR *pcx, in
HRESULT STDMETHODCALLTYPE CMozillaBrowser::PutProperty(BSTR szProperty, VARIANT vtValue) HRESULT STDMETHODCALLTYPE CMozillaBrowser::PutProperty(BSTR szProperty, VARIANT vtValue)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
if (szProperty == NULL) if (szProperty == NULL)
{ {
return E_INVALIDARG; return E_INVALIDARG;
@ -797,6 +815,12 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::PutProperty(BSTR szProperty, VARIANT
HRESULT STDMETHODCALLTYPE CMozillaBrowser::GetProperty(BSTR Property, VARIANT __RPC_FAR *pvtValue) HRESULT STDMETHODCALLTYPE CMozillaBrowser::GetProperty(BSTR Property, VARIANT __RPC_FAR *pvtValue)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
NG_ASSERT(Property); NG_ASSERT(Property);
NG_ASSERT_POINTER(pvtValue, VARIANT); NG_ASSERT_POINTER(pvtValue, VARIANT);
@ -823,6 +847,12 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::GetProperty(BSTR Property, VARIANT __
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Name(BSTR __RPC_FAR *Name) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Name(BSTR __RPC_FAR *Name)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
NG_ASSERT_POINTER(Name, BSTR); NG_ASSERT_POINTER(Name, BSTR);
if (Name == NULL) if (Name == NULL)
{ {
@ -835,6 +865,12 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Name(BSTR __RPC_FAR *Name)
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_HWND(long __RPC_FAR *pHWND) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_HWND(long __RPC_FAR *pHWND)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
NG_ASSERT_POINTER(pHWND, HWND); NG_ASSERT_POINTER(pHWND, HWND);
if (pHWND == NULL) if (pHWND == NULL)
{ {
@ -846,6 +882,12 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_HWND(long __RPC_FAR *pHWND)
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_FullName(BSTR __RPC_FAR *FullName) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_FullName(BSTR __RPC_FAR *FullName)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
NG_ASSERT_POINTER(FullName, BSTR); NG_ASSERT_POINTER(FullName, BSTR);
if (FullName == NULL) if (FullName == NULL)
{ {
@ -858,6 +900,12 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_FullName(BSTR __RPC_FAR *FullName
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Path(BSTR __RPC_FAR *Path) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Path(BSTR __RPC_FAR *Path)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
NG_ASSERT_POINTER(Path, BSTR); NG_ASSERT_POINTER(Path, BSTR);
if (Path == NULL) if (Path == NULL)
{ {
@ -870,6 +918,12 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Path(BSTR __RPC_FAR *Path)
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Visible(VARIANT_BOOL __RPC_FAR *pBool) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Visible(VARIANT_BOOL __RPC_FAR *pBool)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
NG_ASSERT_POINTER(pBool, int); NG_ASSERT_POINTER(pBool, int);
if (pBool == NULL) if (pBool == NULL)
{ {
@ -882,12 +936,24 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Visible(VARIANT_BOOL __RPC_FAR *p
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Visible(VARIANT_BOOL Value) HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Visible(VARIANT_BOOL Value)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return S_OK; return S_OK;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_StatusBar(VARIANT_BOOL __RPC_FAR *pBool) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_StatusBar(VARIANT_BOOL __RPC_FAR *pBool)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
NG_ASSERT_POINTER(pBool, int); NG_ASSERT_POINTER(pBool, int);
if (pBool == NULL) if (pBool == NULL)
{ {
@ -900,12 +966,24 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_StatusBar(VARIANT_BOOL __RPC_FAR
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_StatusBar(VARIANT_BOOL Value) HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_StatusBar(VARIANT_BOOL Value)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return S_OK; return S_OK;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_StatusText(BSTR __RPC_FAR *StatusText) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_StatusText(BSTR __RPC_FAR *StatusText)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
NG_ASSERT_POINTER(StatusText, BSTR); NG_ASSERT_POINTER(StatusText, BSTR);
if (StatusText == NULL) if (StatusText == NULL)
{ {
@ -918,12 +996,24 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_StatusText(BSTR __RPC_FAR *Status
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_StatusText(BSTR StatusText) HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_StatusText(BSTR StatusText)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return S_OK; return S_OK;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_ToolBar(int __RPC_FAR *Value) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_ToolBar(int __RPC_FAR *Value)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
NG_ASSERT_POINTER(Value, int); NG_ASSERT_POINTER(Value, int);
if (Value == NULL) if (Value == NULL)
{ {
@ -936,6 +1026,12 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_ToolBar(int __RPC_FAR *Value)
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_ToolBar(int Value) HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_ToolBar(int Value)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
// No toolbar in control! // No toolbar in control!
return S_OK; return S_OK;
} }
@ -943,6 +1039,12 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_ToolBar(int Value)
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_MenuBar(VARIANT_BOOL __RPC_FAR *Value) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_MenuBar(VARIANT_BOOL __RPC_FAR *Value)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
NG_ASSERT_POINTER(Value, int); NG_ASSERT_POINTER(Value, int);
if (Value == NULL) if (Value == NULL)
{ {
@ -955,6 +1057,12 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_MenuBar(VARIANT_BOOL __RPC_FAR *V
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_MenuBar(VARIANT_BOOL Value) HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_MenuBar(VARIANT_BOOL Value)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
// No menu in control! // No menu in control!
return S_OK; return S_OK;
} }
@ -962,6 +1070,12 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_MenuBar(VARIANT_BOOL Value)
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_FullScreen(VARIANT_BOOL __RPC_FAR *pbFullScreen) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_FullScreen(VARIANT_BOOL __RPC_FAR *pbFullScreen)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
NG_ASSERT_POINTER(pbFullScreen, VARIANT_BOOL); NG_ASSERT_POINTER(pbFullScreen, VARIANT_BOOL);
if (pbFullScreen == NULL) if (pbFullScreen == NULL)
{ {
@ -974,6 +1088,12 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_FullScreen(VARIANT_BOOL __RPC_FAR
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_FullScreen(VARIANT_BOOL bFullScreen) HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_FullScreen(VARIANT_BOOL bFullScreen)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
// No fullscreen mode in control! // No fullscreen mode in control!
return S_OK; return S_OK;
} }
@ -985,114 +1105,234 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_FullScreen(VARIANT_BOOL bFullScre
HRESULT STDMETHODCALLTYPE CMozillaBrowser::Navigate2(VARIANT __RPC_FAR *URL, VARIANT __RPC_FAR *Flags, VARIANT __RPC_FAR *TargetFrameName, VARIANT __RPC_FAR *PostData, VARIANT __RPC_FAR *Headers) HRESULT STDMETHODCALLTYPE CMozillaBrowser::Navigate2(VARIANT __RPC_FAR *URL, VARIANT __RPC_FAR *Flags, VARIANT __RPC_FAR *TargetFrameName, VARIANT __RPC_FAR *PostData, VARIANT __RPC_FAR *Headers)
{ {
return E_NOTIMPL; if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
CComVariant vURLAsString;
if (vURLAsString.ChangeType(VT_BSTR, URL) != S_OK)
{
return E_INVALIDARG;
}
return Navigate(vURLAsString.bstrVal, Flags, TargetFrameName, PostData, Headers);
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::QueryStatusWB(OLECMDID cmdID, OLECMDF __RPC_FAR *pcmdf) HRESULT STDMETHODCALLTYPE CMozillaBrowser::QueryStatusWB(OLECMDID cmdID, OLECMDF __RPC_FAR *pcmdf)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT __RPC_FAR *pvaIn, VARIANT __RPC_FAR *pvaOut) HRESULT STDMETHODCALLTYPE CMozillaBrowser::ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT __RPC_FAR *pvaIn, VARIANT __RPC_FAR *pvaOut)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::ShowBrowserBar(VARIANT __RPC_FAR *pvaClsid, VARIANT __RPC_FAR *pvarShow, VARIANT __RPC_FAR *pvarSize) HRESULT STDMETHODCALLTYPE CMozillaBrowser::ShowBrowserBar(VARIANT __RPC_FAR *pvaClsid, VARIANT __RPC_FAR *pvarShow, VARIANT __RPC_FAR *pvarSize)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_ReadyState(READYSTATE __RPC_FAR *plReadyState) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_ReadyState(READYSTATE __RPC_FAR *plReadyState)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Offline(VARIANT_BOOL __RPC_FAR *pbOffline) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Offline(VARIANT_BOOL __RPC_FAR *pbOffline)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Offline(VARIANT_BOOL bOffline) HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Offline(VARIANT_BOOL bOffline)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Silent(VARIANT_BOOL __RPC_FAR *pbSilent) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Silent(VARIANT_BOOL __RPC_FAR *pbSilent)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Silent(VARIANT_BOOL bSilent) HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Silent(VARIANT_BOOL bSilent)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_RegisterAsBrowser(VARIANT_BOOL __RPC_FAR *pbRegister) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_RegisterAsBrowser(VARIANT_BOOL __RPC_FAR *pbRegister)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_RegisterAsBrowser(VARIANT_BOOL bRegister) HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_RegisterAsBrowser(VARIANT_BOOL bRegister)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_RegisterAsDropTarget(VARIANT_BOOL __RPC_FAR *pbRegister) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_RegisterAsDropTarget(VARIANT_BOOL __RPC_FAR *pbRegister)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_RegisterAsDropTarget(VARIANT_BOOL bRegister) HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_RegisterAsDropTarget(VARIANT_BOOL bRegister)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_TheaterMode(VARIANT_BOOL __RPC_FAR *pbRegister) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_TheaterMode(VARIANT_BOOL __RPC_FAR *pbRegister)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_TheaterMode(VARIANT_BOOL bRegister) HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_TheaterMode(VARIANT_BOOL bRegister)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_AddressBar(VARIANT_BOOL __RPC_FAR *Value) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_AddressBar(VARIANT_BOOL __RPC_FAR *Value)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_AddressBar(VARIANT_BOOL Value) HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_AddressBar(VARIANT_BOOL Value)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Resizable(VARIANT_BOOL __RPC_FAR *Value) HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_Resizable(VARIANT_BOOL __RPC_FAR *Value)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }
HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Resizable(VARIANT_BOOL Value) HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_Resizable(VARIANT_BOOL Value)
{ {
if (!IsValid())
{
NG_ASSERT(0);
return E_UNEXPECTED;
}
return E_NOTIMPL; return E_NOTIMPL;
} }

Просмотреть файл

@ -3,28 +3,41 @@
#ifndef __MOZILLABROWSER_H_ #ifndef __MOZILLABROWSER_H_
#define __MOZILLABROWSER_H_ #define __MOZILLABROWSER_H_
#include "resource.h" // main symbols // This file is autogenerated by the ATL proxy wizard
#include <vector>
#include "WebShellContainer.h"
// This file is autogenerated using the ATL proxy wizard
// so don't edit it! // so don't edit it!
#include "CPMozillaControl.h" #include "CPMozillaControl.h"
// Named property // DEVNOTE: Property and PropertyList should be defined inside CMozillaBrowser
// but were moved outside due to a bug with templates on nested classes
// in VC++ 5.0 which is not at SP3 level.
// Property is a name,variant pair held by the browser. In IE, properties
// offer a primitive way for DHTML elements to talk back and forth with
// the host app. The Mozilla app currently just implements them for
// compatibility reasons
struct Property struct Property
{ {
CComBSTR szName; CComBSTR szName;
CComVariant vValue; CComVariant vValue;
}; };
// These operators are not implemented anywhere. They only need to be
// defined in order for the compiler to accept the vector<Property> // A list of properties
// template... typedef std::vector<Property> PropertyList;
// DEVNOTE: These operators are required since the unpatched VC++ 5.0
// generates code even for unreferenced template methods in
// the file <vector> and will give compiler errors without
// them. Service Pack 1 and above fixes this problem
int operator <(const Property&, const Property&); int operator <(const Property&, const Property&);
int operator ==(const Property&, const Property&); int operator ==(const Property&, const Property&);
typedef std::vector<Property> PropertyList;
class CWebShellContainer;
// Some definitions which are used to make firing events easier
#define CDWebBrowserEvents1 CProxyDWebBrowserEvents<CMozillaBrowser>
#define CDWebBrowserEvents2 CProxyDWebBrowserEvents2<CMozillaBrowser>
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// CMozillaBrowser // CMozillaBrowser
@ -32,9 +45,10 @@ class ATL_NO_VTABLE CMozillaBrowser :
public CComObjectRootEx<CComSingleThreadModel>, public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CMozillaBrowser, &CLSID_MozillaBrowser>, public CComCoClass<CMozillaBrowser, &CLSID_MozillaBrowser>,
public CComControl<CMozillaBrowser>, public CComControl<CMozillaBrowser>,
public CProxyDWebBrowserEvents<CMozillaBrowser>, public CDWebBrowserEvents1,
public CDWebBrowserEvents2,
public CStockPropImpl<CMozillaBrowser, IWebBrowser2, &IID_IWebBrowser2, &LIBID_MOZILLACONTROLLib>, public CStockPropImpl<CMozillaBrowser, IWebBrowser2, &IID_IWebBrowser2, &LIBID_MOZILLACONTROLLib>,
public IProvideClassInfo2Impl<&CLSID_MozillaBrowser, &DIID_DWebBrowserEvents, &LIBID_MOZILLACONTROLLib>, public IProvideClassInfo2Impl<&CLSID_MozillaBrowser, &DIID_DWebBrowserEvents2, &LIBID_MOZILLACONTROLLib>,
public IPersistStreamInitImpl<CMozillaBrowser>, public IPersistStreamInitImpl<CMozillaBrowser>,
public IPersistStorageImpl<CMozillaBrowser>, public IPersistStorageImpl<CMozillaBrowser>,
public IQuickActivateImpl<CMozillaBrowser>, public IQuickActivateImpl<CMozillaBrowser>,
@ -70,7 +84,7 @@ BEGIN_COM_MAP(CMozillaBrowser)
COM_INTERFACE_ENTRY_IMPL(IOleInPlaceActiveObject) COM_INTERFACE_ENTRY_IMPL(IOleInPlaceActiveObject)
COM_INTERFACE_ENTRY_IMPL(IOleControl) COM_INTERFACE_ENTRY_IMPL(IOleControl)
COM_INTERFACE_ENTRY_IMPL(IOleObject) COM_INTERFACE_ENTRY_IMPL(IOleObject)
// COM_INTERFACE_ENTRY_IMPL(IQuickActivate) // COM_INTERFACE_ENTRY_IMPL(IQuickActivate) // This causes size assertion in ATL
COM_INTERFACE_ENTRY_IMPL(IPersistStorage) COM_INTERFACE_ENTRY_IMPL(IPersistStorage)
COM_INTERFACE_ENTRY_IMPL(IPersistStreamInit) COM_INTERFACE_ENTRY_IMPL(IPersistStreamInit)
COM_INTERFACE_ENTRY_IMPL(ISpecifyPropertyPages) COM_INTERFACE_ENTRY_IMPL(ISpecifyPropertyPages)
@ -91,6 +105,7 @@ END_PROPERTY_MAP()
BEGIN_CONNECTION_POINT_MAP(CMozillaBrowser) BEGIN_CONNECTION_POINT_MAP(CMozillaBrowser)
// Fires IE events // Fires IE events
CONNECTION_POINT_ENTRY(DIID_DWebBrowserEvents) CONNECTION_POINT_ENTRY(DIID_DWebBrowserEvents)
CONNECTION_POINT_ENTRY(DIID_DWebBrowserEvents2)
END_CONNECTION_POINT_MAP() END_CONNECTION_POINT_MAP()
@ -129,17 +144,10 @@ protected:
// Indicates the browser is busy doing something // Indicates the browser is busy doing something
BOOL m_bBusy; BOOL m_bBusy;
#if 0 /* XXX: this breaks the build :-( */
// Named property
struct Property
{
CComBSTR szName;
CComVariant vValue;
};
typedef std::vector<Property> PropertyList;
#endif
// Property list // Property list
PropertyList m_PropertyList; PropertyList m_PropertyList;
virtual HRESULT CreateWebShell(); virtual HRESULT CreateWebShell();
virtual BOOL IsValid(); virtual BOOL IsValid();

Просмотреть файл

@ -421,7 +421,6 @@ library MOZILLACONTROLLib
interface IWebBrowser; interface IWebBrowser;
interface IWebBrowserApp; interface IWebBrowserApp;
interface IDispatch; interface IDispatch;
// [default, source] dispinterface DWebBrowserEvents2; [default, source] dispinterface DWebBrowserEvents2;
[default, source] dispinterface DWebBrowserEvents;
}; };
}; };

Просмотреть файл

@ -15,7 +15,7 @@
#define _WIN32_WINNT 0x0400 #define _WIN32_WINNT 0x0400
#define _ATL_APARTMENT_THREADED #define _ATL_APARTMENT_THREADED
// ATL headers
#include <atlbase.h> #include <atlbase.h>
//You may derive a class from CComModule and use it if you want to override //You may derive a class from CComModule and use it if you want to override
//something, but do not change the name of _Module //something, but do not change the name of _Module
@ -23,6 +23,11 @@ extern CComModule _Module;
#include <atlcom.h> #include <atlcom.h>
#include <atlctl.h> #include <atlctl.h>
// STL headers
#include <vector>
// Mozilla headers
#ifdef USE_NGPREF #ifdef USE_NGPREF
#include "nsIPref.h" #include "nsIPref.h"
#endif #endif
@ -50,10 +55,13 @@ extern CComModule _Module;
#include "nsVoidArray.h" #include "nsVoidArray.h"
#include "nsCRT.h" #include "nsCRT.h"
// Mozilla control headers
#include "resource.h"
#include "BrowserDiagnostics.h" #include "BrowserDiagnostics.h"
#include "MozillaControl.h" #include "MozillaControl.h"
#include "WebShellContainer.h"
#include "MozillaBrowser.h" #include "MozillaBrowser.h"
#include "WebShellContainer.h"
//{{AFX_INSERT_LOCATION}} //{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.

Просмотреть файл

@ -10,6 +10,8 @@ static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID);
CWebShellContainer::CWebShellContainer(CMozillaBrowser *pOwner) CWebShellContainer::CWebShellContainer(CMozillaBrowser *pOwner)
{ {
m_pOwner = pOwner; m_pOwner = pOwner;
m_pEvents1 = m_pOwner;
m_pEvents2 = m_pOwner;
} }
@ -92,11 +94,14 @@ CWebShellContainer::BeginLoadURL(nsIWebShell* aShell, const PRUnichar* aURL)
VARIANT_BOOL bCancel = VARIANT_FALSE; VARIANT_BOOL bCancel = VARIANT_FALSE;
long lFlags = 0; long lFlags = 0;
m_pOwner->Fire_BeforeNavigate(bstrURL, lFlags, bstrTargetFrameName, pvPostData, bstrHeaders, &bCancel); m_pEvents1->Fire_BeforeNavigate(bstrURL, lFlags, bstrTargetFrameName, pvPostData, bstrHeaders, &bCancel);
// TODO m_pEvents2->Fire_BeforeNavigate2(...)
SysFreeString(bstrURL); SysFreeString(bstrURL);
SysFreeString(bstrTargetFrameName); SysFreeString(bstrTargetFrameName);
SysFreeString(bstrHeaders); SysFreeString(bstrHeaders);
if (bCancel == VARIANT_TRUE) if (bCancel == VARIANT_TRUE)
{ {
if (aShell) if (aShell)
@ -116,7 +121,8 @@ NS_IMETHODIMP
CWebShellContainer::ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aProgress, PRInt32 aProgressMax) CWebShellContainer::ProgressLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt32 aProgress, PRInt32 aProgressMax)
{ {
ATLTRACE(_T("CWebShellContainer::ProgressLoadURL()\n")); ATLTRACE(_T("CWebShellContainer::ProgressLoadURL()\n"));
m_pOwner->Fire_ProgressChange(aProgress, aProgressMax); m_pEvents1->Fire_ProgressChange(aProgress, aProgressMax);
m_pEvents2->Fire_ProgressChange(aProgress, aProgressMax);
return NS_OK; return NS_OK;
} }
@ -128,7 +134,8 @@ CWebShellContainer::EndLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, PRInt
USES_CONVERSION; USES_CONVERSION;
OLECHAR *pszURL = W2OLE((WCHAR *) aURL); OLECHAR *pszURL = W2OLE((WCHAR *) aURL);
BSTR bstrURL = SysAllocString(pszURL); BSTR bstrURL = SysAllocString(pszURL);
m_pOwner->Fire_NavigateComplete(bstrURL); m_pEvents1->Fire_NavigateComplete(bstrURL);
// TODO m_pEvents2->Fire_NavigateComplete2(...)
m_pOwner->m_bBusy = FALSE; m_pOwner->m_bBusy = FALSE;
SysFreeString(bstrURL); SysFreeString(bstrURL);
@ -161,7 +168,7 @@ NS_IMETHODIMP
CWebShellContainer::OnStartBinding(nsIURL* aURL, const char *aContentType) CWebShellContainer::OnStartBinding(nsIURL* aURL, const char *aContentType)
{ {
ATLTRACE(_T("CWebShellContainer::OnStartBinding()\n")); ATLTRACE(_T("CWebShellContainer::OnStartBinding()\n"));
return NS_ERROR_FAILURE; return NS_OK;
} }
@ -169,7 +176,7 @@ NS_IMETHODIMP
CWebShellContainer::OnProgress(nsIURL* aURL, PRInt32 aProgress, PRInt32 aProgressMax) CWebShellContainer::OnProgress(nsIURL* aURL, PRInt32 aProgress, PRInt32 aProgressMax)
{ {
ATLTRACE(_T("CWebShellContainer::OnProgress()\n")); ATLTRACE(_T("CWebShellContainer::OnProgress()\n"));
return NS_ERROR_FAILURE; return NS_OK;
} }
@ -177,7 +184,14 @@ NS_IMETHODIMP
CWebShellContainer::OnStatus(nsIURL* aURL, const nsString &aMsg) CWebShellContainer::OnStatus(nsIURL* aURL, const nsString &aMsg)
{ {
ATLTRACE(_T("CWebShellContainer::OnStatus()\n")); ATLTRACE(_T("CWebShellContainer::OnStatus()\n"));
return NS_ERROR_FAILURE;
USES_CONVERSION;
BSTR bstrText = SysAllocString(W2OLE((PRUnichar *) aMsg));
m_pEvents1->Fire_StatusTextChange(bstrText);
m_pEvents2->Fire_StatusTextChange(bstrText);
SysFreeString(bstrText);
return NS_OK;
} }
@ -185,5 +199,5 @@ NS_IMETHODIMP
CWebShellContainer::OnStopBinding(nsIURL* aURL, PRInt32 aStatus, const nsString &aMsg) CWebShellContainer::OnStopBinding(nsIURL* aURL, PRInt32 aStatus, const nsString &aMsg)
{ {
ATLTRACE(_T("CWebShellContainer::OnStopBinding()\n")); ATLTRACE(_T("CWebShellContainer::OnStopBinding()\n"));
return NS_ERROR_FAILURE; return NS_OK;
} }

Просмотреть файл

@ -1,7 +1,8 @@
#ifndef WEBSHELLCONTAINER_H #ifndef WEBSHELLCONTAINER_H
#define WEBSHELLCONTAINER_H #define WEBSHELLCONTAINER_H
class CMozillaBrowser; // This is the class that handles the XPCOM side of things, callback
// interfaces into the web shell and so forth.
class CWebShellContainer : class CWebShellContainer :
public nsIWebShellContainer, public nsIWebShellContainer,
@ -9,13 +10,17 @@ class CWebShellContainer :
{ {
public: public:
CWebShellContainer(CMozillaBrowser *pOwner); CWebShellContainer(CMozillaBrowser *pOwner);
protected: protected:
virtual ~CWebShellContainer(); virtual ~CWebShellContainer();
// Protected members // Protected members
protected: protected:
nsString m_sTitle; nsString m_sTitle;
CMozillaBrowser *m_pOwner; CMozillaBrowser *m_pOwner;
CDWebBrowserEvents1 *m_pEvents1;
CDWebBrowserEvents2 *m_pEvents2;
public: public:
// nsISupports // nsISupports

Просмотреть файл

@ -63,7 +63,7 @@ LLIBS = $(MYLIBS) \
shell32.lib \ shell32.lib \
-SUBSYSTEM:windows -SUBSYSTEM:windows
LCFLAGS = /D "WIN32" /GX LCFLAGS = /D "WIN32" /GX /FR
LFLAGS = /DLL LFLAGS = /DLL
include <$(DEPTH)\config\rules.mak> include <$(DEPTH)\config\rules.mak>