Re: GetSaveFileName / GetOpenFileName Crash

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello,

I also have VS2005 installed on the same machine with VS .Net 2003. I'm not
sure if it was doing it before I installed VS2005 or not but compiling under
either one did it. It seems to have something to do with .Net 2.0 runtime
per that Event log I sent in the last message and "Unable to open shim
database version registry key - v2.0.50727.00000". FWIW, I rand RegMon and
didn't see any failures.

It is machine specific but I'll look in to it more probably next week before
I have any time.

Thanks!

""Jeffrey Tan[MSFT]"" <jetan@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:F7lzmN6fGHA.5184@xxxxxxxxxxxxxxxxxxxxxxxx
Hi David ,

Thanks for your post!

I have compiled your code snippet with VS.net2003. Then I tested it on my
Win2003 SP1 and WinXP SP2 machines with the 3 actions you described. But
all the actions worked well without the problem you described. So I
suspect
this problem is your machine-specific.

I have also searched our internal database with keyword "GetOpenFileName"
and "crash" without a similar record. Currently, I have the following
suggestions:
1. I suggest you turn off any anti-virus softwares on your system, the
anti-virus softwares may be the main cause of strange behavior of the
system.
2. Have you tested the application on other machines? Can the problem be
always reproduced?
3. You may use certain debugger to attach to the failing application, I
think there may be certain unhandled exception in the #3 action, so the
program ended. With the debugger, we can catch the exception and get the
full call stack regarding this exception. I recommended ADPlus as the
debugger for the application. Please refer to the KB about how to use
ADPlus to catch the crash information of an application:
"How to use ADPlus to troubleshoot "hangs" and "crashes""
http://support.microsoft.com/default.aspx?scid=kb;en-us;286350

Note: setup the symbol path for the debugger is critical to get the
correct
and enough information for the exception.

At last, below the full code, I used to test your problem, but it works
well on my side, for your information:

#define _WIN32_WINNT 0x0500
#include<windows.h>
#include<stdio.h>

void main()
{
BOOL result;
OPENFILENAME ofn;

TCHAR fu[_MAX_PATH];
memset(fu, 0, sizeof(fu));

// Initialize OPENFILENAME

ZeroMemory(&ofn, sizeof(OPENFILENAME));
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = NULL;
ofn.lpstrFile = fu;
ofn.nMaxFile = sizeof(fu)-5;
ofn.lpstrFilter = "Whatever\0*.POS\0";
ofn.nFilterIndex = 1;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
// Display the Open dialog box.

result=GetOpenFileName(&ofn);
getchar();
}
I will wait for your further feedback, thanks!

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.



.



Relevant Pages

  • RE: GetSaveFileName / GetOpenFileName Crash
    ... I have compiled your code snippet with VS.net2003. ... You may use certain debugger to attach to the failing application, ... we can catch the exception and get the ... OPENFILENAME ofn; ...
    (microsoft.public.win32.programmer.ui)
  • Re: You wanted defensive writing...
    ... Couldn't you have set the debugger to break on all exceptions? ... > I've created an application that loads Caudill's TreeListView as its ... > I commented the line that called the insertion on start-up, ... > The exception caught me unaware, ...
    (microsoft.public.dotnet.csharp.general)
  • Re: You wanted defensive writing...
    ... Couldn't you have set the debugger to break on all exceptions? ... > I've created an application that loads Caudill's TreeListView as its ... > I commented the line that called the insertion on start-up, ... > The exception caught me unaware, ...
    (microsoft.public.dotnet.general)
  • Re: Problem with KITL?
    ... > Enable kernel debugger ... This OK if KdStub stumbling on its own BP. ... Exception in debugger, Addr=0x801AB864 - attempting to recover ...
    (microsoft.public.windowsce.platbuilder)
  • Re: Core dump and gcc
    ... > compiling my program, I am getting error and core dump. ... > Thanks in advance Sam ... gcc is not the equivalent to VC++ in the winders world. ... Which debugger depends on what system you are developing on and what ...
    (comp.unix.programmer)