Access Violation on MoveToNextField

  • Hi Julian,
    With WPtools 4.22a.

    My users use the text editor intensively all day and some times they get an access violation.

    Here what is done on the WPRichText object of Form1:

    In Form2
    Form1.WPRichText1.Clear;
    Form1.WPRichText1.FastCopyProperties(WPRichText2);
    Form1.WPRichText1.AsString := WPRichText2.AsString;
    Form1.WPRichText1.ReformatAll();

    In Form1
    WPRichText1.WorkOnText := wpHeader;
    WPRichText1.CPPosition := 0;
    WPRichText1.MoveToNextField(True); <= The access violation happened here.

    Have you noticed any problem with function MoveToNextField or do I have to execute an other command to be sure that the object is OK?

    Thank you.

    • Offizieller Beitrag

    Hi,

    MoveToFiled is defined in unit WPRich.PAS - please check it out there.

    If you a ctive the define WPDEBUG in file WPINC.INC you can see where the AV happens, maybe the header is empty, but I really don't know.

    In wptools 4 switching WorkOnText changed the intern data pointers of the RTF engine, this can cause problems and so in V5 the function was implemented using layers.

    Julian