Re: GetSaveFileName / GetOpenFileName Crash
- From: "David F." <df2705@xxxxxxxxxxxxxxxx>
- Date: Fri, 26 May 2006 00:21:51 -0700
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.
.
- Follow-Ups:
- Re: GetSaveFileName / GetOpenFileName Crash
- From: "Jeffrey Tan[MSFT]"
- Re: GetSaveFileName / GetOpenFileName Crash
- References:
- GetSaveFileName / GetOpenFileName Crash
- From: David F.
- RE: GetSaveFileName / GetOpenFileName Crash
- From: "Jeffrey Tan[MSFT]"
- GetSaveFileName / GetOpenFileName Crash
- Prev by Date: Re: Instances of an Application
- Next by Date: Re: SetThemeAppProperties and SetWindow Theme do not effect Unicode data handling
- Previous by thread: RE: GetSaveFileName / GetOpenFileName Crash
- Next by thread: Re: GetSaveFileName / GetOpenFileName Crash
- Index(es):
Relevant Pages
|