Microsoft KB Archive/131560

= BUG: Creating a Header Class Definition in a VCX Causes Error =

Article ID: 131560

Article Last Modified on 9/30/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition

-



This article was previously published under Q131560



SYMPTOMS
When a visual class library (VCX) is edited programmatically and the VCX is opened with the MODIFY CLASS command, Visual FoxPro is halted and an exception error is generated.



CAUSE
The Exception error is the result of a programming error. The information placed in the VCX under program control is erroneous. In particular, creating a Header or a Column class as a visual class yields this error because it is not possible to create these classes in a VCX.



RESOLUTION
Ensure that you are creating classes that are allowed in a visual class library. Visual classes that cannot be created in a VCX require a container to exist. They include:


 * Column class
 * Header class
 * Page class
 * Separator class
 * OptionButton class
 * DataEnvironment class
 * Cursor class
 * Relation class

You can however subclass all of these classes under program control.



STATUS
Microsoft has confirmed the fact that the product halts to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Problem
The following program duplicates the Exception error. Please exercise caution if you decide to run this sample program because it causes FoxPro to halt. This code is provided as an illustration only. The comments highlight the source of the error. CREATE CLASS grid1 OF myvcx AS Grid &&Set the ColumnCount property to 1 USE myvcx.vcx LOCATE FOR baseclass = 'header' COPY TO myvcx2 NEXT 1 APPEND FROM myvcx2 GO BOTTOM REPLACE objname with 'myheader'\


 * The replace statement below is the cause of the error
 * A header object is created, and this is illegal in a VCX.

REPLACE properties WITH STRTRAN(properties,"header1","myheader") REPLACE reserved1 WITH 'Class' REPLACE parent WITH SPACE(0) REPLACE UniqueID WITH LEFT(UniqueID,LEN(UniqueID)-1) + ; IIF(RIGHT(UniqueID,1)='Z','Q','Z') USE ERASE myvcx2.DBF ERASE myvcx2.FPT MODIFY CLASS myheader OF myvcx * choose the class MyHeader and click Open

Additional query words: crash hang

Keywords: kbbug KB131560

-

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

© Microsoft Corporation. All rights reserved.