RichEdit access violation

Posted on 2008-10-22
Last Modified: 2012-05-05
I have a rich edit set to handle more text than would usually fit in that control by setting maxlength to High(Integer)-1024.  When I search the text using findtext and it is a long way into the text I get an access violation.  I am assuming that is because the search routine for findtext cannot *see* beyond a certain limit, even though it does find the text looked for.

Is there a way to stop the access violations?
Question by:jdthedj
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 13

Expert Comment

ID: 22781766
What is the a/v? Do you what index in the richedit you hit when you a/v'd? Maybe you crossed some 32bit bounds you didn't realize were still there.

Author Comment

ID: 22781869
Thanks for the reply ThievingSix - What is a/v?

Author Comment

ID: 22781892
Sorry - hit button before finished.  Violation is

Access Violation at address 00450C4D in module HTML_Tables.exe Read of address 00A93A38
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 13

Expert Comment

ID: 22781915
Do you know what line produced that error?

Author Comment

ID: 22781974
The richedit has 4354 lines and 135348 chars in the one I am testing.  The violation occurs at random when I search for anything near the end - eg at line 3971.  It happens when I close the search dialog after the text has been found.
LVL 35

Accepted Solution

torimar earned 250 total points
ID: 22782149
Since you modified the RE control to do what it isn't usually supposed to do, I assume you will only get rid of that A/V if you also modify the Findtext method in order to do what it wasn't originally made for doing.

You may have to write your own wrapper functions. Here's some material that might come in handy:

Alternatively, you might want to consider trying to find a third party RE control (not based on the MS dll and its restrictions) that by default supports huge amounts of text. I know there is a rxRichEdit in the popular rxLib ( which then was integrated into the Jedi VC Library (, and there is also the pretty popular, but commercial RichView component set (, but I wasn't able to retrieve the specs regarding huge text support in either of them.
LVL 37

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 250 total points
ID: 22783224
when you run it from the Ide with F8
and then use menu Search / Find Error  at 00450C4D
you could locate the code causing the AV

Author Comment

ID: 22789685
Thanks Geert - I tried that and it says "Invalid address value. Must be a hexadecimal value in the range 00000000 - FFFFFFFF".  I checked my typing, and that must be within the range?

Author Closing Comment

ID: 31508979
Looks like I must reluctantly look for another component to avoid the access violations.

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Printing problem 2 124
How to debug For loops? 3 74
Graphics32 under Delphi 10.1 Berlin 2 180
Problem working with dynamic array - help 2 48
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question