Access violation when saving or using long hyperlinked text

  • I have found that there is a limit to how long a hyperlink can be... if it is too long, WPTools4 dies with an access violation when saving, such as saving to a file. For example, I use the hyperlink attribute to duplicate the hyperlink marked text elsewhere in a document on a mail merge. (This is accomplished using bookmarks in WPTools5, but this is out old legacy app which uses WPTools4 and I can't change this).

    Anyway, if the user selects a long paragraph, which might be 1000 chars or more, and clicks the Hyperlink toolbar button. It marks if fine, but I then get an access violation if I try to use this hyperlinked text in a mailmerge, or simply attempt to "SaveToFile".

    WPTools 4.25
    Delphi 5

  • Thanks, I increased the "buffer" array in WriteAttributes from 2000 to 10000 (overkill probably), and that solved it.

    But I went a bit further and wanted to prevent the stamp from using the enitre marked text (would duplicate the long marked paragraph being hyperlinked, once for the stamp and once for the displayable text. So I modified the line: s := MakeStringRTFConform(ReadNextURL) to be something like: s := MakeStringRTFConform('LinkedToSummary'). While this reduces the burden on the data written to the database, I randomly get an access violation when exporting to a PDF or when previewing the form unless I parse the WPRichText and remove all hyperlink attributes.

    The error I get about half the time when I don't remove the hyperlink attribute is:

    (In assembler since I don't have the source to the file that contains GetHyperLinkStampAt.)

    While it seems to work when I remove the hyperlink attribute, it would be nice to not have to do that. I'm sure it has something to do with me shortening the stamp, but why?

    Thanks