Click here to Skip to main content
15,927,803 members
Home / Discussions / C#
   

C#

 
GeneralIOleCommandTarget in a .net COM server! HELP! HELP!! Pin
SmallUmka30-Sep-04 23:49
SmallUmka30-Sep-04 23:49 
GeneralGetThumbNailImageAbort Pin
Nick Seng30-Sep-04 23:24
Nick Seng30-Sep-04 23:24 
GeneralRe: GetThumbNailImageAbort Pin
Nick Parker1-Oct-04 6:09
protectorNick Parker1-Oct-04 6:09 
GeneralRe: GetThumbNailImageAbort Pin
Nick Seng1-Oct-04 8:23
Nick Seng1-Oct-04 8:23 
GeneralCollectionForm Pin
Claudia Peschke30-Sep-04 21:48
Claudia Peschke30-Sep-04 21:48 
Generaltables Pin
pat27088130-Sep-04 21:37
pat27088130-Sep-04 21:37 
Generalmaking 'AmbientProperties' Pin
Roger Alsing30-Sep-04 20:53
Roger Alsing30-Sep-04 20:53 
Generalout-of-memory exception thrown when using Find Pin
clatten30-Sep-04 20:37
clatten30-Sep-04 20:37 
I use the code below for a simple search function in a richtextbox. When I load larger files, and try to search it will always throw an out-of-memory exception. From the debugging it seems to be richTextBox.Find that is the culprit.

For an example, searching File1 that is 1800kB is no problem but File2 at 17000kB will always throw the exception. Opening File2 in, for example Notepad, and search is no problem.

Anyone knows why, is there a limitation with richTextBoxes and why can I then load the file with the Loadfile function?
Is there any workaround for it?

I also ran into another problem, with one specific file I don't get the exception when I search but instead "Failed to load resources from resource file. Please check your setup". I use the default settings and I did run the "fix application". Still it will crash with this message. Any fix for this?




try
{
RichTextBox.SelectionColor = Color.Black;
int searchEnd = RichTextBox.TextLength;
searchStart = RichTextBox.Find(searchTextBox.Text, searchStart, searchEnd, RichTextBoxFinds.MatchCase);
RichTextBox.SelectionColor = Color.Blue;
//RichTextBox.SelectionFont = Font.Bold;
RichTextBox.GetPositionFromCharIndex(searchStart);
RichTextBox.Focus();
RichTextBox.ScrollToCaret();
if ( searchStart < searchEnd ) { searchStart++; }
else { searchStart = 0; }
}
catch (Exception f)
{ MessageBox.Show("Failed to search " + searchFile + "\n" + f.ToString()); }
GeneralRe: out-of-memory exception thrown when using Find Pin
clatten1-Oct-04 0:10
clatten1-Oct-04 0:10 
QuestionWill this cause memory leak? Pin
mitreviper30-Sep-04 20:22
mitreviper30-Sep-04 20:22 
AnswerRe: Will this cause memory leak? Pin
Stefan Troschuetz30-Sep-04 21:31
Stefan Troschuetz30-Sep-04 21:31 
AnswerRe: Will this cause memory leak? Pin
Nnamdi Onyeyiri1-Oct-04 2:59
Nnamdi Onyeyiri1-Oct-04 2:59 
AnswerRe: Will this cause memory leak? Pin
Nemanja Trifunovic1-Oct-04 6:24
Nemanja Trifunovic1-Oct-04 6:24 
GeneralDataGrid Select Pin
jzb30-Sep-04 16:58
jzb30-Sep-04 16:58 
GeneralRe: DataGrid Select Pin
Christian Graus30-Sep-04 17:07
protectorChristian Graus30-Sep-04 17:07 
GeneralRe: DataGrid Select Pin
IronSnake1-Oct-04 3:08
IronSnake1-Oct-04 3:08 
Generalweb site Pin
cmarmr30-Sep-04 14:52
cmarmr30-Sep-04 14:52 
GeneralRe: web site Pin
Christian Graus30-Sep-04 15:12
protectorChristian Graus30-Sep-04 15:12 
GeneralRe: web site Pin
Nick Parker30-Sep-04 17:18
protectorNick Parker30-Sep-04 17:18 
GeneralThis crashes out on me on dataAdapter.Fill(ds) Pin
mcupryk30-Sep-04 14:40
mcupryk30-Sep-04 14:40 
GeneralRe: This crashes out on me on dataAdapter.Fill(ds) Pin
Christian Graus30-Sep-04 15:13
protectorChristian Graus30-Sep-04 15:13 
GeneralRe: This crashes out on me on dataAdapter.Fill(ds) Pin
Heath Stewart30-Sep-04 15:27
protectorHeath Stewart30-Sep-04 15:27 
GeneralBinarySearch problem... Pin
Tesic Goran30-Sep-04 13:18
professionalTesic Goran30-Sep-04 13:18 
GeneralRe: BinarySearch problem... Pin
Heath Stewart30-Sep-04 15:16
protectorHeath Stewart30-Sep-04 15:16 
GeneralRe: BinarySearch problem... Pin
Tesic Goran30-Sep-04 17:52
professionalTesic Goran30-Sep-04 17:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.