FIX: ClassWizard Reports Invalid Filename When Importing Class

Last reviewed: September 18, 1997
Article ID: Q122259
1.00 1.50 1.51 | 1.00 2.00 4.00
WINDOWS        | WINDOWS NT
kbtool kbbuglist kbfixlist

The information in this article applies to:

  • The ClassWizard, included with:

        - Microsoft Visual C++ for Windows, versions 1.0, 1.5, and 1.51
        - Microsoft Visual C++, 32-bit Edition, versions 1.0, 2.0 and 4.0
    

SYMPTOMS

When attempting to import a class into a project using ClassWizard, and locating the header file and implementation file using the Browse buttons to select a path to each file, you may get an error when you click the OK button even though the paths to the files are valid.

If either path has a drive letter in it, ClassWizard displays a message box with this error message:

  • The file name "<full path to file>" is not a valid file name. Please enter a valid file name.

When the message box is dismissed, the Import Class dialog has the path highlighted for change even though the file name and path are valid.

If either path is a relative path that does not include drive letter, such as ..\..\DIR1\DIR2\MYFILE.H, ClassWizard displays a message box with this error message:

  • The file names [<full path to header file>, <full path to implementation file>] for class "<class name>" do not exist or are invalid file names.

ClassWizard will accept a relative path that indicates one level above the current directory, such as ..\DIR1\DIR2\MYFILE.H.

RESOLUTION

To successfully import the class, change the path to the header and implementation files, so they are not relative paths and do not contain a drive letter. For example, ClassWizard will not accept this:

   C:\DIR1\MYFILE.H and ..\..\..\MYFILE.H

But ClassWizard will accept this:

   \DIR1\MYFILE.H

An alternative solution is to copy the files to the project directory. Note that in any case, you need to add the class implemenation files to your project. When you import a class, ClassWizard will not update your project to include the implementation files for the classes you import.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ 4.1.


Additional reference words: 1.00 1.50 1.51 2.00 wizard pathname 4.00 4.10
KBCategory: kbtool kbbuglist kbfixlist
KBSubcategory: WizardIss vcbuglist400 vcfixlist410
Keywords : vcbuglist400 vcfixlist410 WizardIss kbbuglist kbfixlist kbtool
Version : 1.00 1.50 1.51 | 1.00 2.00 4.00
Platform : NT WINDOWS
Solution Type : kbfix


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 18, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.