Added some explanatory error messages for common problems
git-svn-id: svn://10.0.0.236/trunk@68782 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
06765eb611
commit
8bbe9f4732
@ -285,8 +285,7 @@ HRESULT CMozillaBrowser::OnDraw(ATL_DRAWINFO& di)
|
||||
if (!IsValid())
|
||||
{
|
||||
RECT& rc = *(RECT*)di.prcBounds;
|
||||
Rectangle(di.hdcDraw, rc.left, rc.top, rc.right, rc.bottom);
|
||||
DrawText(di.hdcDraw, mStartupErrorMessage.c_str(), -1, &rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
||||
DrawText(di.hdcDraw, mStartupErrorMessage.c_str(), -1, &rc, DT_TOP | DT_LEFT | DT_WORDBREAK);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
@ -704,15 +703,19 @@ HRESULT CMozillaBrowser::CheckBinDirPath()
|
||||
memset(szBinDirPath, 0, sizeof(szBinDirPath));
|
||||
if (mSystemRegKey.QueryValue(szBinDirPath, c_szMozillaBinDirPathValue, &dwBinDirPath) == ERROR_SUCCESS)
|
||||
{
|
||||
// Bin directory is already set
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
// TODO store string in resource
|
||||
// Find out if the user wants to find the directory
|
||||
TCHAR szMsg[1024];
|
||||
::LoadString(_Module.m_hInstResource, IDS_LOCATEMOZILLA, szMsg, sizeof(szMsg) / sizeof(szMsg[0]));
|
||||
TCHAR szMsgTitle[1024];
|
||||
::LoadString(_Module.m_hInstResource, IDS_LOCATEMOZILLATITLE, szMsgTitle, sizeof(szMsgTitle) / sizeof(szMsgTitle[0]));
|
||||
|
||||
UINT nAnswer = ::MessageBox(NULL,
|
||||
_T("The browser control does not know where the Mozilla is installed "
|
||||
"and may not function correctly.\n"
|
||||
"Do you want to locate Mozilla now?"),
|
||||
_T(""), MB_ICONQUESTION | MB_YESNO);
|
||||
szMsg,
|
||||
szMsgTitle, MB_ICONQUESTION | MB_YESNO);
|
||||
|
||||
if (nAnswer == IDNO)
|
||||
{
|
||||
@ -801,7 +804,9 @@ HRESULT CMozillaBrowser::CreateBrowser()
|
||||
{
|
||||
NG_ASSERT(0);
|
||||
NG_TRACE(_T("Could not create preference object rv=%08x\n"), (int) rv);
|
||||
mStartupErrorMessage = _T("Error - could not create preference object");
|
||||
TCHAR szMsg[1024];
|
||||
::LoadString(_Module.m_hInstResource, IDS_CANNOTCREATEPREFS, szMsg, sizeof(szMsg) / sizeof(szMsg[0]));
|
||||
mStartupErrorMessage = szMsg;
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
@ -172,6 +172,13 @@ BEGIN
|
||||
IDS_PROJNAME "MozillaControl"
|
||||
END
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_LOCATEMOZILLA "The browser control does not know where Mozilla is installed and may not function correctly.\nDo you want to locate Mozilla now?"
|
||||
IDS_LOCATEMOZILLATITLE "Cannot locate Mozilla bin directory"
|
||||
IDS_CANNOTCREATEPREFS "The Mozilla control cannot create a critical component. This prevents the control from functioning correctly. Possible reasons for the problem are:\n\n1. The PATH environment variable does not point to the Mozilla bin directory.\n2. The registry key HKEY_LOCAL_MACHINE\\Software\\Mozilla\\BinDirectoryPath registry key has not been set or is incorrect\n3. The file component.reg has not been generated.\n\nPlease refer to http://www.iol.ie/~locka/mozilla/mozilla.htm for guidance on how to resolve these problems."
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@ -8,6 +8,9 @@
|
||||
#define IDR_POPUP_PAGE 202
|
||||
#define IDR_POPUP_LINK 203
|
||||
#define IDR_POPUP_CLIPBOARD 204
|
||||
#define IDS_LOCATEMOZILLA 1000
|
||||
#define IDS_LOCATEMOZILLATITLE 1001
|
||||
#define IDS_CANNOTCREATEPREFS 1002
|
||||
#define ID_BROWSE_BACK 32768
|
||||
#define ID_BROWSE_FORWARD 32769
|
||||
#define ID_FILE_REFRESH 32772
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user