CFileDialog causes application to Hang on Windows 2000

VC

    Sponsored Links

    Next

  • 1. Objective Grid issue with Manifest file
    I'm trying to add Windows XP manifests to a project written in MFC that uses Stingray's Objective Grid 70. All the normal controls seem to work but the grid has a lot of trouble. The compiler we're using is Visual C++ 7.0. The grid works normally if the application has no manifest. When a manifest is created (either compiled in, or as a separate file), the following symptoms occur: * Setting focus to a grid cell shows it as full of square boxes (the 'unprintable character' glyph. * In debug mode, ASSERT(AfxCheckMemory()) starts failing after calls into the grid. It looks like the grid is doing something funny. Has anyone got any ideas what's going on here?
  • 2. Background colour in a list box
    Hello, I want to mark the last choosen entries in a list box by changing the background colour of the text strings (MFC / VC6). I am not shure if this is possible. Thanks for any clue! Kai Sandner
  • 3. Transparent Radio Button
    I'm trying to create a transparent radio button, so that it fits cleanly into a dialog box that has a bitmap in the background. Here was my first attempt after reading some ideas online: BOOL CXTransButton::OnEraseBkgnd(CDC* pDC) { return TRUE; } HBRUSH CXTransButton::CtlColor(CDC* pDC, UINT nCtlColor) { pDC->SetBkMode(TRANSPARENT); return (HBRUSH)GetStockObject(NULL_BRUSH); } Here is my message map: BEGIN_MESSAGE_MAP(CXTransButton, CButton) ON_WM_ERASEBKGND() ON_WM_CTLCOLOR_REFLECT() END_MESSAGE_MAP() All that happens is the entire radio button, except for the circle, is black. Any ideas to throw me in the right direction would be greatly appreciated. Thanks! -Adam

CFileDialog causes application to Hang on Windows 2000

Postby Faisal Yaqoob » Sat, 27 Nov 2004 00:35:49 GMT

I have developed an application using VC 7.1.
In this application a call to CFileDialog::DoModal() causes the application
to hang and never return.
It happens on random machines. I have tested it on different machines and it
doesn't hang on some of the machines but it hangs on others.

After debugging I've found that the application hangs on a call to
GetSaveFileName() function within the DoModal function.

What is the reason for it and whats the work around?

Thanks,
Faisal



RE: CFileDialog causes application to Hang on Windows 2000

Postby andmort » Sat, 27 Nov 2004 23:31:59 GMT

You may need to provide more info, context of how the code is called, what 
parameters you pass in, where the dialog is set to initialise to exactly 
(full path) is it network or local, does it repro if you adjust any of the 
aformentioned parameters.

Andy Mortimer [MS]
Please do not send email directly to this alias. This alias is for 
newsgroup purposes only

This posting is provided "AS IS" with no warranties, and confers no rights. 
OR if you wish to include a script sample in your post please add "Use of 
included script samples are subject to the terms specified at 
 http://www.**--****.com/ " 



Re: CFileDialog causes application to Hang on Windows 2000

Postby Rail Jon Rogut » Sun, 28 Nov 2004 03:40:43 GMT

While running have you checked the value of sizeof(OPENFILENAMEW)...?  What
was the result?

    Rail
-- 
      Recording Engineer/Software Developer
      Rail Jon Rogut Software
       http://www.**--****.com/ 
      mailto: XXXX@XXXXX.COM 








Re: CFileDialog causes application to Hang on Windows 2000

Postby Faisal Yaqoob » Tue, 30 Nov 2004 22:12:15 GMT

This is how I am using it
CFileDialog fileDialog(FALSE, _T("csv"), NULL,
OFN_OVERWRITEPROMPT|OFN_PATHMUSTEXIST, NULL, this, sizeof(OPENFILENAME));

if (fileDialog.DoModal() ==IDOK )

{

UpdateData(TRUE);

m_strOutputFileName = fileDialog.GetPathName();

UpdateData(FALSE);

}



I also tried by providing NULL in place of sizeof (OPENFILENAME), but it
still hangs.

Please help.

Thanks,

Faisal





rights.



Re: CFileDialog causes application to Hang on Windows 2000

Postby andmort » Fri, 03 Dec 2004 20:33:00 GMT

Have you checked the versions of comctl32.dll on your problematic PC's?

Andy Mortimer [MS]
Please do not send email directly to this alias. This alias is for 
newsgroup purposes only

This posting is provided "AS IS" with no warranties, and confers no rights. 
OR if you wish to include a script sample in your post please add "Use of 
included script samples are subject to the terms specified at 
 http://www.**--****.com/ " 



Re: CFileDialog causes application to Hang on Windows 2000

Postby RmFpc2FsIFlhcW9vYg » Wed, 22 Dec 2004 23:03:02 GMT

Following is the version info for comctl32.dll on probelmatic PC:

File Version: 5.81.4916.400
Product Version: 5.50.4916.400

Please suggest, my client needs the 'Browse' button to work on his system :)





Re: CFileDialog causes application to Hang on Windows 2000

Postby andmort » Thu, 23 Dec 2004 00:31:50 GMT

You might want to try adjusting the value of  _WIN32_WINNT inside stdafx.h 
to see if that has any effect.

Andy Mortimer [MS]
Please do not send email directly to this alias. This alias is for 
newsgroup purposes only


Re: CFileDialog causes application to Hang on Windows 2000

Postby RmFpc2FsIFlhcW9vYg » Thu, 23 Dec 2004 22:01:01 GMT

I tried adjusting that too. The default value I believe is 0x0500, which I 
believe is for windows 2000, I changed to 0x0400 but the application still 
hangs, also tried with 0x0600, but then I started having compile time errors, 
like:

C:\Program Files\Microsoft Visual Studio .NET 
2003\Vc7\atlmfc\include\afxwin.h(3289): error C2061: syntax error : 
identifier 'PSCROLLBARINFO'
C:\Program Files\Microsoft Visual Studio .NET 
2003\Vc7\atlmfc\include\afxwin4.inl(148): error C2065: 'PSCROLLBARINFO' : 
undeclared identifier
C:\Program Files\Microsoft Visual Studio .NET 
2003\Vc7\atlmfc\include\afxwin4.inl(148): error C2146: syntax error : missing 
')' before identifier 'pScrollInfo'
C:\Program Files\Microsoft Visual Studio .NET 
2003\Vc7\atlmfc\include\afxwin4.inl(148): error C2761: 'BOOL 
CScrollBar::GetScrollBarInfo(void) const' : member function redeclaration not 
allowed
C:\Program Files\Microsoft Visual Studio .NET 
2003\Vc7\atlmfc\include\afxwin4.inl(148): error C2059: syntax error : ')'
C:\Program Files\Microsoft Visual Studio .NET 
2003\Vc7\atlmfc\include\afxwin4.inl(149): error C2143: syntax error : missing 
';' before '{'
C:\Program Files\Microsoft Visual Studio .NET 
2003\Vc7\atlmfc\include\afxwin4.inl(149): error C2447: '{' : missing function 
header (old-style formal list?)

Can you guide me here?

I think ( I am not sure ) this occurs only with Windows 2000 and IE6 
combination. Would it help in identifying the problem?

Thanks,
Faisal






Re: CFileDialog causes application to Hang on Windows 2000

Postby andmort » Thu, 23 Dec 2004 22:34:04 GMT

What is it about the PC's that fail? Do the folders contain lots of files, 
or files which are huge, long filenames etc? Perhaps do some analysis into 
what is different in working and non working scenarios. Also, you could use 
filemon utility from sysinternals.com to see if files are actually being 
accessed. Also can review 
 http://www.**--****.com/ ;EN-US;Q286350 in order to 
use adplus to create a hang dump of the problem and analyse the stacks.


Re: CFileDialog causes application to Hang on Windows 2000

Postby RmFpc2FsIFlhcW9vYg » Wed, 29 Dec 2004 17:05:01 GMT

Finally, I managed to fix this bug...well not completely but it is now working.

The reason being for not working on some of the windows 2000 machines was: 
That I was giving 'null' for the lpszFilter parameter. That should mean there 
is no filter. But this gives trouble with some of the Windows 2000 machines.

Again, if I give some filter, other than '*.*', it still gives trouble. 

So, During Hit and Trial, I found that it works well on all the windows 2000 
machines only if I give a single filter of *.*

Do you have any idea about the issue? Is this a known issue or what? Is 
there a work around?

Thanks,
Faisal





Re: CFileDialog causes application to Hang on Windows 2000

Postby Alexander Grigoriev » Thu, 30 Dec 2004 05:43:45 GMT

Remember that the filter string should be double zero-terminated.









Re: CFileDialog causes application to Hang on Windows 2000

Postby andmort » Fri, 07 Jan 2005 00:26:41 GMT

Indeed. Note the remarks section:-

Remarks
The lpszFilter parameter is used to determine the type of filename a file 
must have to be displayed in the file list box. The first string in the 
string pair describes the filter; the second string indicates the file 
extension to use. Multiple extensions may be specified using a semicolon 
(;) as the delimiter. The string ends with two vertical bar (||) 
characters, followed by a NULL character. You can also use a CString object 
for this parameter.

For example, Microsoft Excel permits users to open files with extensions 
.XLC (chart) or .XLS (worksheet), among others. The filter for Excel could 
be written as:

static char BASED_CODE szFilter[] = "Chart Files (*.xlc)|*.xlc|Worksheet 
Files (*.xls)|*.xls|Data Files (*.xlc;*.xls)|*.xlc; *.xls|All Files 
(*.*)|*.*||";
Note, however, that if you plan to use this string to directly update the 
OPENFILENAME structure, you should delimit your strings with the null 
character, (\0), instead of the vertical bar (|).


Similar Threads:

1.CFileDialog hangs on Windows 2000

Hello,

I have an application written in VisualStudio C++ .NET 2003 which use both 
managed and MFC code (the managed code is for XML) that hangs when a 
CFileDialog is created in a Windows 2000 machine. In my development machine 
(Windows XP) the app works fine, both debug and release version. 
To isolate if this is a kind of bug in my app I generate a simple SDI app 
using the wizard and add the same code that creates the CFileDialog. This app 
works in the Windows 2000 machine, the file dialog works as it should.

So I tried to debug my app in the W2K machine using WinDbg and I got this 
output:


ModLoad: 76b10000 76b4e000   D:\WINNT\system32\comdlg32.dll
ModLoad: 77850000 7788e000   D:\WINNT\system32\cscui.dll
ModLoad: 770a0000 770c3000   D:\WINNT\system32\CSCDLL.DLL
ModLoad: 76f80000 76f8f000   D:\WINNT\system32\ntshrui.dll
ModLoad: 773c0000 773d5000   D:\WINNT\system32\ATL.DLL
ModLoad: 71500000 715fc000   D:\WINNT\System32\browseui.dll
ModLoad: 76dd0000 76de1000   D:\WINNT\system32\mydocs.dll
ModLoad: 04a30000 04b7a000   D:\WINNT\system32\SHDOCVW.DLL
ModLoad: 703d0000 703eb000   D:\WINNT\System32\actxprxy.dll
(2d0.64c): Unknown exception - code 000006f4 (first chance)

I wonder if this could mean something to anyone
I appreciate any help on this topic.

Thanks! 

2.Inconsistent CFileDialog behavior between Windows XP and 2000

Hello,

I have extended the CFileDialog class so I can select Folders instead of 
just
Files.

When I send the CDM_GETSPEC message to get the currently selected item, I
get the correct folder when I test with Windows XP. However, when I run my
app on Wndows 2000, DM_GETSPEC returns an empty string (""). Also, sending
of the CDM_GETFILEPATH message works as desired for XP, but only returns the
parent folder in 2000.

Any help would be much appreciated.

-Neil 




Return to VC

 

Who is online

Users browsing this forum: No registered users and 69 guest