Microsoft KB Archive/168827

= FIX: ActiveX Control with "Message" Property Causes Page Fault =

Article ID: 168827

Article Last Modified on 3/24/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a

-



This article was previously published under Q168827



SYMPTOMS
Running a form created in Visual FoxPro 5.0 or 5.0a with an ActiveX control that has a property called "MESSAGE" causes an Invalid Page Fault.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This has been corrected in Visual FoxPro 6.0.



MORE INFORMATION
An ActiveX control created in Visual Basic 5.0 with a property called "MESSAGE" (in either uppercase or lowercase letters) causes an Invalid Page Fault in Visual FoxPro 5.0 or 5.0a running on Windows 95. The error on Windows NT is an "Application error" with Visual FoxPro referencing memory at location 0xffffffff that could not be read. MESSAGEBOX is a reserved word in Visual FoxPro and may possibly be the cause of the behavior. ActiveX controls normally do not need to avoid the container's reserved words in order to work properly. The use of other Visual FoxPro reserved words as ActiveX control property names does not, necessarily, cause the same behavior.

Steps to Reproduce Behavior
 In Visual Basic 5.0, create an ActiveX control as follows:  Double-click the Form to open a Code window. From the Tools menu, select Add Procedure. On the Add Procedure dialog box, select Property and type "message" as the new property name. In the Code window, in both the Property Let and Property Get procedures, change the property type from "variant" to "string." Save the project and control files as "Test." Save the .ocx file as "Test.ocx" (The name of the control project and the control's Name property should be "Test.")</li></ol> </li> In Visual FoxPro 5.0 or 5.0a, add the new control (Test.ocx) to the list of controls in the Tools Options dialog box. The control will appear in the ActiveX controls list as Project1.Test.</li> Create a form and add the new ActiveX control. Run the form and an Invalid Page Fault (Windows 95) or Application Error (Windows NT) will occur.</li></ol>

NOTE: Adding new properties with names of other Visual FoxPro reserved words may not result in similar behavior.

<div class="references_section">