CFileDialog causes application to Hang on Windows 2000

VC

    Sponsored Links

    Next

  • 1. Multiple closed networks and UDP. Please help me.
    I am using Visual C++ version 6. My next project is to write an application that receives data from three UDP data streams. Each data stream will originate from a different computer. Each of the three computers will be in its own closed network. In addition, my program also needs to act as a TCP server on the regular (open) network at the customer site. (I will also write a small TCP client application that will connect to my TCP server program.) I have worked with TCP many times, but never UDP. I have never worked with closed networks. I have questions. Please help me. I assume the computer for my application will need 4 network connections. One to each closed network and one to the regular network. Question: Is this correct? If my 4 network card plan is not correct. Please tell me how to implement this situation. Several years ago I wrote my networking classes which are based on MFC CAsyncSocket. When I open a socket to receive one UDP socket stream do I somehow have to stipulate which network to use? Or does this magically work? When I open my TCP server socket, how do I stipulate which network is to be used? I have looked at CAsyncSocket and I see nothing about network connection selection. How will this work?
  • 2. using ReadString
    a simple question: CString s1; CStdioFile f1; f1.Open("a.txt", CFile::modeRead) f1.ReadString( s1 ); f1.Close(); Does ReadString reads a full line? Does it look for a '\n', and then returns? This seems to be the behavior, nevertheless - nowhere in the documentation this is explained. the only thing says in MSDN is : Call this member function to read text data into a buffer from the file associated with the CArchive object. Can I relay on this behavior? (reading a full line)
  • 3. Create MFC dll and use with rundll32
    Dear all, I want to do a MFC dll that catch windows messages and run in background. To do this I want to start the dll with rundll32 at the windows startup. I wrote the dll but I can't use with rundll32, it seems that is not possible to find the entry-point. Any suggestions?
  • 4. How to override the behavior of Ctrl+Tab in a MFC based MDI application
    By default, press Ctrl+Tab in a MFC based MDI application will switch between opened documents. But in some situation, I need bypass this behavior and continue dispatching this message to my CDockablePane. But I don't know which base class has defined above document switching behavior, so that I don't know where to redefine the behavior. How could I achieve it?

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