Microsoft KB Archive/122259

= FIX: ClassWizard Reports Invalid Filename When Importing Class =

Article ID: 122259

Article Last Modified on 12/9/2003

-

APPLIES TO

 The ClassWizard, when used with:  Microsoft Visual C++ 6.1

 Microsoft Visual C++ 5.0 Learning Edition

 Microsoft Visual C++ 2.0 Professional Edition

 Microsoft Visual C++ 4.0 Professional Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q122259

<div class="symptoms_section">

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 " " 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 implementation file>] for class " " 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.

<div class="resolution_section">

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: <pre class="fixed_text">  C:\DIR1\MYFILE.H and ..\..\..\MYFILE.H But ClassWizard will accept this: <pre class="fixed_text">  \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.

<div class="status_section">

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 query words: kbVC400bug 1.00 1.50 1.51 2.00 wizard pathname 4.00 4.10 kbNoUpdate

Keywords: kbbug kbfix kbvc410fix kbwizard KB122259

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.