I have installed Platform SDK Windows Server 2003 (I work in VS 6.0 on WinXP) and I have a problem with CFileDialog.
This code
worked just fine before defining _WIN32_WINNT, which I need to use different functions and constants. Now, when I define itCode:void CFileTestView::OnViewFile() { CFileDialog dlg(TRUE); dlg.DoModal(); }
my code just crashes in ~CFileDialog (when dlg does out of scope and is destroyed). Since m_ofn member of CFileDialog depends on this _WIN32_WINT:Code:#ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif
I rewrote the code this way:Code:typedef struct tagOFN { // ... #if (_WIN32_WINNT >= 0x0500) void * pvReserved; DWORD dwReserved; DWORD FlagsEx; #endif // (_WIN32_WINNT >= 0x0500) } OPENFILENAME
but I still get a first-chance exception in FileTest.Exe (KERNEL32.dll) 0xC0000005: Access Violation (the usual stuff).Code:void CFileTestView::OnViewFile() { CFileDialog dlg(TRUE); #if (_WIN32_WINNT >= 0x0500) dlg.m_ofn.pvReserved = NULL; dlg.m_ofn.dwReserved = 0; dlg.m_ofn.FlagsEx = 0; #endif dlg.DoModal(); }
Any ideas? Thanks!


Marius Bancila
Reply With Quote
Bookmarks