BUG: You receive a "Cannot find the file <FileName>" error message in Windows 95 or in Windows 98 when you open a document and the associated executable is an MFC application that has a long file name (148806)
The information in this article applies to:
- The Microsoft Foundation Classes (MFC), when used with:
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Editions 4.2
- Microsoft Visual C++, 32-bit Editions 5.0
- Microsoft Visual C++, 32-bit Editions 6.0
This article was previously published under Q148806 SYMPTOMS When you try to open a document whose extension is
associated with an MFC application that has a long file name on Windows 95 or
Windows 98, a dialog box with an error message similar to the following
appears: Cannot find the file 'filename' (or one of its
components). Make sure the path and filename are correct and that all required
libraries are available. Closing the message box won't bring up the
application's windows, but will leave the executable file open. On
Windows Millennium Edition (Me), the error message is:
Windows cannot find '<filename>'. You may have typed the name incorrectly
in the Run dialog, or another open program cannot find a system file. To search
for a file, click the Start button, and then click Search. CAUSE The MFC function CWinApp::RegisterShellFileTypes() writes
the application's 8.3 file name to the registry. However,
CWinApp::EnableShellOpen() calls ::GlobalAddAtom() with the application's long
file name. Windows 95 and Windows 98 cannot handle this situation.
RESOLUTION Override CWinApp::EnableShellOpen() using the sample code
below to pass the application's short file name to ::GlobalAddAtom().
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
This problem was corrected in Microsoft Visual C++
.NET.
Modification Type: | Major | Last Reviewed: | 9/1/2005 |
---|
Keywords: | kbBug kbcode kbfix kbNoUpdate KB148806 kbAudDeveloper |
---|
|