explorer: handle child window creation errors

svn path=/trunk/; revision=24143
This commit is contained in:
Martin Fuchs 2006-09-16 15:39:07 +00:00
parent bb1f92d0d3
commit a06bdc9503

View file

@ -246,9 +246,12 @@ FileChildWindow::FileChildWindow(HWND hwnd, const FileChildWndInfo& info)
_header_wdths_ok = false;
if (!_left_hwnd && !_right_hwnd)
return;
if (entry)
set_curdir(entry);
else
else if (_root._entry)
set_curdir(_root._entry);
if (_left_hwnd) {
@ -391,6 +394,11 @@ FileChildWindow* FileChildWindow::create(const FileChildWndInfo& info)
FileChildWindow* child = static_cast<FileChildWindow*>(
create_mdi_child(info, mcs, WINDOW_CREATOR_INFO(FileChildWindow,FileChildWndInfo)));
if (!child->_left_hwnd && !child->_right_hwnd) {
SendMessage(info._hmdiclient, WM_MDIDESTROY, (WPARAM)child->_hwnd, 0);
MessageBox(info._hmdiclient, TEXT("Error opening child window"), TEXT("ROS Explorer"), MB_OK);
}
return child;
}