From: Guido Franzke on
Ok, after CString, I still have the problem on some computers, not on all.
I think, should be a Windows XP problem.

On the computer not showing the drives in "My Computer", I go to the
directory having jpg files. But they are not shown, even not when I use the
filter "All files *.*". But the directory before having documents, shows all
files correctly.

Now, I type a filename in my jpg-directory by hand (I cannot see the file
list, but I know the correct spelling of my file), and click "Open" in
CFileDialog, the dialog and the programm crashes!
A dump file shows me in wincore.cpp the callback funtion AfxWndProc,
stopping when
return AfxCallWndProc(pWnd, hWnd, nMsg, wParam, lParam);
Unfortunately the dump does not show me the vlues of the variables.

Why does CFileDialog crash?
Guido


From: Tom Serface on
Does the same thing happen in a debug build? If so you may be able to see
an assert, or break in the code to check the call stack to see where it is
crashing. Sounds like maybe you have a memory issue. Are you trying to
collect multiple files from the open file dialog?

Tom

"Guido Franzke" <guidof73(a)yahoo.de> wrote in message
news:e5T7NeFPKHA.4468(a)TK2MSFTNGP04.phx.gbl...
> Ok, after CString, I still have the problem on some computers, not on all.
> I think, should be a Windows XP problem.
>
> On the computer not showing the drives in "My Computer", I go to the
> directory having jpg files. But they are not shown, even not when I use
> the
> filter "All files *.*". But the directory before having documents, shows
> all
> files correctly.
>
> Now, I type a filename in my jpg-directory by hand (I cannot see the file
> list, but I know the correct spelling of my file), and click "Open" in
> CFileDialog, the dialog and the programm crashes!
> A dump file shows me in wincore.cpp the callback funtion AfxWndProc,
> stopping when
> return AfxCallWndProc(pWnd, hWnd, nMsg, wParam, lParam);
> Unfortunately the dump does not show me the vlues of the variables.
>
> Why does CFileDialog crash?
> Guido
>
>

From: Joseph M. Newcomer on
See below...
On Wed, 23 Sep 2009 16:08:52 +0200, "Guido Franzke" <guidof73(a)yahoo.de> wrote:

>Ok, after CString, I still have the problem on some computers, not on all.
>I think, should be a Windows XP problem.
>
>On the computer not showing the drives in "My Computer", I go to the
>directory having jpg files. But they are not shown, even not when I use the
>filter "All files *.*". But the directory before having documents, shows all
>files correctly.
>
>Now, I type a filename in my jpg-directory by hand (I cannot see the file
>list, but I know the correct spelling of my file), and click "Open" in
>CFileDialog, the dialog and the programm crashes!
****
OK, you used the nonsense phrase "crash" as if it has meaning. You did not say exactly
what the error was.

The most common cause of a failure on a return statement is either an access fault or an
invalid instruction exception caused by a stack clobber, caused by a memory overwrite.
There is a long-known bug with CFileDialog where code compiled with old libraries (say,
under VS6) erroneously assumes a size for the data structure on the stack, but when run in
Vista or XP, the data structure is actually longer and a memory overwrite occurs. Largely,
because people are migrating from VS6 and the older libraries, this has gone away, but it
could be your problem.

What was the call stack?

And can you run it under a debugger, instead of trying to work from a stack dump? And if
you say "But I don't have Visual Studio installed", I really don't care. You can install
WinDbg and copy your pdb file across to the target machine, and get real data. WinDbg
isn't nearly as nice as VS as a debugger, but it is free and easily installed.

Also, it doesn't hurt if you tell us that it occurs, say, only in the release mode and not
in debug mode. And it REALLY helps if you tell us what the service packs are on the
machines on which it fails, and which version of VS you are using. Someone might
recognize something about the bug.
joe
>A dump file shows me in wincore.cpp the callback funtion AfxWndProc,
>stopping when
>return AfxCallWndProc(pWnd, hWnd, nMsg, wParam, lParam);
>Unfortunately the dump does not show me the vlues of the variables.
>
>Why does CFileDialog crash?
>Guido
>
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm