static inline FIND_DATA FindFirst(const wxString& spec,
FIND_STRUCT *finddata)
{
- return ::FindFirstFile(spec, finddata);
+ return ::FindFirstFile(spec.fn_str(), finddata);
}
static inline bool FindNext(FIND_DATA fd, FIND_STRUCT *finddata)
bool wxDir::Open(const wxString& dirname)
{
delete M_DIR;
- m_data = new wxDirData(dirname);
+
+ // The Unix code does a similar test
+ if (wxDirExists(dirname))
+ {
+ m_data = new wxDirData(dirname);
- return true;
+ return true;
+ }
+ else
+ {
+ m_data = NULL;
+
+ return false;
+ }
}
bool wxDir::IsOpened() const