Microsoft KB Archive/131710

= FIX: TYPE Returns "" Instead of "U" For OleBoundControl =

Article ID: 131710

Article Last Modified on 12/3/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b for Macintosh

-



This article was previously published under Q131710



SYMPTOMS
If you run a form containing an OleBoundControl object and the TYPE function attempts to verify the type of an undefined property of the object, the TYPE function returns an empty string ("") instead of the expected "U" value.



RESOLUTION
If your application uses the return value of the TYPE function, test for an empty value ("") as a return value for all cases where an object uses the OleBoundControl as a BaseClass. For example: DO CASE CASE .BaseClass="Oleboundcontrol" IF TYPE(' . .UndefProp')="U" ; OR TYPE (' . .UndefProp')="" *Place code here ELSE *Place code here ENDIF ENDCASE



STATUS
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in Visual FoxPro 5.0a.



Steps to Reproduce Problem
 Create a form. On the DataEnvironment menu, click Add Table. In the Add Table dialog box, select Tables, and then select the Employee table located in the SAMPLES\DATA directory.  Click the OleBoundControl control on the Form Controls toolbar, and place the control on the form. Then modify the ControlSource property of the control to this: ControlSource: Employee.Photo   Place a command button on the form, and modify its Click event handler to include this code: SKIP Thisform.Refresh  Save the form as FRMTEST, and run it.</li>  Use the following code in the Debug window (for Visual FoxPro 3.x versions) or the Watch window in the Visual FoxPro 5.0 Debugger to verify the return value of the OleBoundControl control: TYPE('Frmtest.OleBoundControl1.BadProp') && Property does not exist </li></ol>

Keywords: kbbug kbfix kbvfp500afix kbprogramming kbcode KB131710

-

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

© Microsoft Corporation. All rights reserved.