+// Basically, the problem is that we need to use the "new" size of the
+// OPENFILENAME structure
+// (OPENFILENAME_SIZE_VERSION_400 + void* + DWORD + DWORD)
+// in Windows 2000 and XP so that the new-style file dialog with the
+// "Places Bar" shows up. Unfortunately, there seems to be no reliable way
+// to test for it in the headers, so we need to always make one
+// with the extra bytes.
+//
+// We don't do this on Windows CE, however.
+#ifdef __WXWINCE__
+ typedef OPENFILENAME wxOPENFILENAME;
+
+ static const DWORD wxOPENFILENAME_V5_SIZE = sizeof(OPENFILENAME);
+#else // !__WXWINCE__
+ struct wxOPENFILENAME : public OPENFILENAME
+ {
+ // fields added in Windows 2000/XP comdlg32.dll version
+ void *pVoid;
+ DWORD dw1;
+ DWORD dw2;
+ };
+
+ // hardcoded sizeof(OPENFILENAME) in the Platform SDK: we have to do it
+ // because sizeof(OPENFILENAME) in the headers we use when compiling the
+ // library could be less if _WIN32_WINNT is not >= 0x500
+ static const DWORD wxOPENFILENAME_V5_SIZE = 88;
+
+ // this is hardcoded sizeof(OPENFILENAME_NT4) from Platform SDK
+ static const DWORD wxOPENFILENAME_V4_SIZE = 76;
+#endif // __WXWINCE__/!__WXWINCE__
+
+// always try the new one first
+static DWORD gs_ofStructSize = wxOPENFILENAME_V5_SIZE;
+