You receive the "An unknown error occurred while accessing an unknown file" error message when you run a Visual C++ 5.0 application after you install a Visual C++ 6.0 application (217772)



The information in this article applies to:

  • The Microsoft Foundation Classes (MFC), when used with:
    • Microsoft Visual C++, 32-bit Enterprise Edition 6.0
    • Microsoft Visual C++, 32-bit Professional Edition 6.0
    • Microsoft Visual C++, 32-bit Learning Edition 6.0
  • Microsoft Windows Internet Services (WinInet)

This article was previously published under Q217772

SYMPTOMS

After installing a Visual C++ 6.0 application that uses MFC, the Mfc42.dll that was shipped with Visual C++ 6.0 may be installed. This may cause problems for existing applications that were developed using MFC from Visual C++ 5.0 and that used the CAsyncMonikerFile class. In particular, a call to CAsyncMonikerFile::Open() will return an the following error:
An unknown error occurred while accessing an unknown file
This error occurs on machines that have Internet Explorer 3.02 or earlier installed.

CAUSE

This problem occurs because of a bug in Visual C++ 6.0's implementation of the CAsyncMonikerFile MFC class.

WORKAROUND

To work around this problem, use one of the following methods:
  • Install Internet Explorer 4.0 or higher.
  • Place the Mfc42.dll from the Visual C++ 5.0 version in the same directory as the EXE or DLL. This may not be an option if you depend Mfc42.dll being in the system directory. For example, an OCX that downloads over the Internet would use the version of MFC in the windows system directory.
  • Link to MFC statically for any application developed with Visual C++ 5.0 and using CAsyncMonikerFile.

    Note This method does not work for an OCX developed with Visual C++ 5.0 because you cannot link statically to MFC when developing an OCX in Visual C++ 5.0.

Modification Type:MajorLast Reviewed:9/2/2005
Keywords:kbBug kbNoUpdate kbprb KB217772 kbAudDeveloper