CFileDialog causes application to Hang on Windows 2000

VC

    Sponsored Links

    Next

  • 1. VISTA & MFC icon
    Hi I am showing icons in a List control . It works ok in XP,2000, and 98 But when I run application in Vista the icons are displayed as black square(16 X 16 ) Please can you tell me is their any format difference in the Vista and other OS for Icons. Or can you please let me know what should be done to correct this error. Thanks Anup
  • 2. SetCheck
    Hi, I have a dialog box with 2 radio buttons. i have a code like this. CMyDlg::CMyDlg(CWnd* pParent ) : CDialog(CMyDlg::IDD, pParent) { } CMyDlg::~CMyDlg() { } void CMyDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_A, m_AButton); //CButtom m_AButton DDX_Control(pDX, IDC_B, m_BButton); //CButton m_BButton } BEGIN_MESSAGE_MAP(CMyDlg, CDialog) ON_BN_CLICKED(IDC_A, OnA) ON_BN_CLICKED(IDC_B, OnB) END_MESSAGE_MAP() BOOL CMyDlg::OnInitDialog() { m_AButton.EnableWindow(TRUE); m_BButton.SetCheck(TRUE); } In this case i want that a function should be invoked every time the statement m_AButton.SetCheck(TRUE); is executed. How can i do this. Thanks in advance.
  • 3. MyDocuments folder
    hi, i am tring to create folder in MyDocuments, with this function HANDLE hFile = CreateFile(path,GENERIC_WRITE|GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); where path = _T("%USERPROFILE%\\Documenti") + _T("\\FileName.xxx"); i used ("%USERPROFILE%\\Documenti to get the path of mydocuments but i didnt find the file , i used GetLastError(); where the function tell me the path is incorect any idea to get the path of mydocuments folder thanks for help
  • 4. How to get the source file of IE with API Hook?
    I want to get the html source from IE in my program. Currently I hooked the recv() in wsock32.dll. It did work, but it is hard to get the complete source. I wonder if I can hook some high-level APIs, from mshtml.dll, shdocvw.dll... But I used 'depends.exe' to see if there're some exported funtion I can hook, but in vain. How do I get the source?
  • 5. DoModal() returns -1 in 64-bit executable
    Hi All, I'm having a problem with creating a dialog with a 64-bit executable. The issue is the following: I have a dialog, derived from CDialog that I create and show using DoModal(). This works fine when I compile and run in a 32-bit Vista environment. But when I compile it for 64-bit Vista, the executable runs and the constructor for my custom dialog gets called, but "DoModal()" returns -1 and the dialog never appears. The msdn documentation for CDialog says that DoModal() returns -1 when a dialog cannot be created, but that's not very specific. Does anyone have any ideas as to what may be going wrong? Thanks in advance and regards, Hector.

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 48 guest