From: Julian Smart Date: Sat, 2 Apr 2005 17:38:14 +0000 (+0000) Subject: Fixed bug preventing dir enumeration from working on WinCE X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3bd8a40543a03914e55a532a8bc600b5d77d6859 Fixed bug preventing dir enumeration from working on WinCE Prevented crash on WinCE by removing hidden root style (a bug in Windows causes crash in child traversal/data retrieval) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index d792d8e4d2..3394172477 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -524,7 +524,13 @@ bool wxGenericDirCtrl::Create(wxWindow *parent, Init(); - long treeStyle = wxTR_HAS_BUTTONS | wxTR_HIDE_ROOT; + long treeStyle = wxTR_HAS_BUTTONS; + + // On Windows CE, if you hide the root, you get a crash when + // attempting to access data for children of the root item. +#ifndef __WXWINCE__ + treeStyle |= wxTR_HIDE_ROOT; +#endif #ifdef __WXGTK20__ treeStyle |= wxTR_NO_LINES; @@ -771,7 +777,7 @@ void wxGenericDirCtrl::ExpandDir(wxTreeItemId parentId) wxString dirName(data->m_path); -#if defined(__WINDOWS__) || defined(__DOS__) || defined(__OS2__) +#if (defined(__WINDOWS__) && !defined(__WXWINCE__)) || defined(__DOS__) || defined(__OS2__) // Check if this is a root directory and if so, // whether the drive is avaiable. if (!wxIsDriveAvailable(dirName))