Solved

RichEdit access violation

Posted on 2008-10-22
9
431 Views
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?
0
Comment
Question by:jdthedj
9 Comments
 
LVL 13

Expert Comment

by:ThievingSix
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.
0
 
LVL 3

Author Comment

by:jdthedj
ID: 22781869
Thanks for the reply ThievingSix - What is a/v?
0
 
LVL 3

Author Comment

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

Access Violation at address 00450C4D in module HTML_Tables.exe Read of address 00A93A38
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 13

Expert Comment

by:ThievingSix
ID: 22781915
Do you know what line produced that error?
0
 
LVL 3

Author Comment

by:jdthedj
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.
0
 
LVL 35

Accepted Solution

by:
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:
http://msdn.microsoft.com/en-us/library/bb787877(VS.85).aspx
http://msdn.microsoft.com/en-us/library/bb788011(VS.85).aspx
http://msdn.microsoft.com/en-us/library/aa366781(VS.85).aspx

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 (http://www.dummzeuch.de/delphi/rxlibsf/english.html) which then was integrated into the Jedi VC Library (http://homepages.borland.com/jedi/jvcl/), and there is also the pretty popular, but commercial RichView component set (http://www.trichview.com), but I wasn't able to retrieve the specs regarding huge text support in either of them.
0
 
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
0
 
LVL 3

Author Comment

by:jdthedj
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?
0
 
LVL 3

Author Closing Comment

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

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

832 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