Microsoft KB Archive/192975

= BUG: ClassWizard Parsing Error with MBCS Helpstring in .odl File =

Article ID: 192975

Article Last Modified on 12/2/2003

-

APPLIES TO


 * Microsoft Visual C++ 5.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 5.0 Professional Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition

-



This article was previously published under Q192975



SYMPTOMS
After adding a multibyte character set (MBCS) helpstring to a property in an .odl file, a dialog box appears before displaying the ClassWizard:

  Parsing error. Illegal line encountered. Input line [id(1), helpstring("b .)] short test



CAUSE
ClassWizard has problems handling MBCS characters.



RESOLUTION
Use #define macros for the MBCS string. Add the #define statements either directly to the .odl file, or #include them from another file. For example: #define MyHelp "MBCS characters" .  .   [id(1), helpstring(MyHelp)] short test



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.



MORE INFORMATION
There are other workarounds possible, but they are not recommended:


 * Add any MBCS helpstrings after adding all the custom properties.
 * Move the property definition in the .odl file outside of the ClassWizard AFX_ODL_PROP markers. In your source code files, move the property outside of ClassWizard markers around any maps that reference it.

These workarounds do not permit you to maintain variables with MBCS helpstrings using ClassWizard. They may be acceptable since the only things you would normally do with a property after creating it are add attributes (like a helpstring) that ClassWizard doesn't maintain, or delete the variable.

Steps to Reproduce Behavior
 Create an MFC ActiveX control using the MFC ActiveX Control Wizard (accept the default settings). Open ClassWizard. Add a custom property named "test" of type Short to the base class on the Automation tab. Click OK. Open the .odl file for the project.  Edit the custom property, which is enclosed between ClassWizard AFX_ODL_PROP markers. Add a 'helpstring' keyword containing any MBCS character on this property.

Example: [id(1), helpstring("MBCS characters")] short test;  Save the .odl file.</li> Open Class Wizard and add another custom property named "test2" of type Short.</li> Click OK; Visual C++ appears to freeze.</li> Maximize a window on the desktop and then minimize it. The following ClassWizard error message is now visible:

Parsing error. Illegal line encountered. Input line [id(1), helpstring("b .)] short test

</li> Click OK on the error dialog box.</li>  Look at the .odl file. The property lines appear similar to the following: [id(1), helpstring("b .)] short test;     [id(2)] short test2;                        </li></ol>

If the helpstring has an MBCS character at the end, ClassWizard replaces the second quote character and the MBCS character with one or more dots. If the MBCS character is not at the end of the string, the next character to the right disappears.

Keywords: kberrmsg kbbug kbnoupdate kbwizard kbpending KB192975

-

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

© Microsoft Corporation. All rights reserved.