Quote Originally Posted by Ajay Vijay
I am also having the same error....
No kidding... Now we are two
It's enought to do this:
Code:
CFileDialog f(FALSE);
And you get the first-chance exception.
MFC70 has 7th parameter to give the sizeof OPENFILENAME structure, which does not exist in MFC42 (6.0v). We can set it as:
Well, I know, I read the MSDN too, but unfortunatelly I work on VS 6.0 and CFileDialog doesn't have the 7th DWORD paramether.
The problem is at line 121 in Afx.INL:
Yes, it crashes there.
Quote Originally Posted by padex
From what I see in MSDN, 0x0501 means Windows XP and Windows .NET Server. Perhaps you need a different value for 2003?
I have Platform SDK for Windows Server 2003 which is supposed to work with all Windows OS. Platform SDK XP works only with WinXP.
While debugging this thing, I found that 'lStructSize' is 76, which when the above code comes, becomes 88. I have defined in stdafx.h (before ALL headers).
Instead of this CFileDialog is compiled using OLD value of _WIN32_WINNT, and my code is compiled using new value (88 shows!).
WHY??
sizeof(OPENFILENAME) == 76 is _WIN32_WINNT is not defined or is lower than 0x500 and 88 otherwise.
Code:
#if (_WIN32_WINNT >= 0x0500)
  void *        pvReserved;
  DWORD         dwReserved;
  DWORD         FlagsEx;
#endif // (_WIN32_WINNT >= 0x0500)
I have also this problem with includes. Though I put SDK folders (include, lib, bin and src) before the default folders from VS6.0 at Options, Directories if I step into the constructor it goes to the VC98\MFC\SRC\DLGFILE.cpp so it doesn't use the CFileDialog from Platform SDK...