Microsoft KB Archive/198425

= PRB: GetLineFromChar Method Does Not Function in VFP 5.0 =

Article ID: 198425

Article Last Modified on 12/11/1999

-

APPLIES TO


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

-



This article was previously published under Q198425



SYMPTOMS
The GetLineFromChar method of the Richtx32.ocx control returns erroneous values in Visual FoxPro 5.0x. This behavior happens with version 5.01.4316 and version 6.00.8169 of the Richtx32.ocx.



RESOLUTION
Turn off the ActiveX control dual interface (VTABLE binding) by adding the following line to the Load event of the form: =SYS(2333,0)



MORE INFORMATION
The GetLineFromChar method should return the line number containing a specified character position. This method returns valid values when running under Visual FoxPro 3.0b and 6.0.

Steps to Reproduce Behavior
 Create a form and add a rich text control to the form.  In the Init method of the form, place the following code: Thisform.Olecontrol1.text=REPLICATE("a",200)  Add a text box to the form and name it Text1.  Add a command button that contains the following code: CLEAR foundline=THISFORM.olecontrol1.getlinefromchar(THISFORM.text1.VALUE) ?foundline THISFORM.REFRESH  Run the form. In the text box, type the following values, and pressing the command button after each number:

10

100

150

15

250



Instead of returning a valid line number you may see values in scientific notation, date time values, the word .NULL., a blank value, or a memory protection error may occur. The memory protection errors seem to occur mostly under Windows NT, but they can occur under Windows 95 or Windows 98.

<div class="references_section">