trichview.support
Re: AVs every time I try to change style |
Author |
Message |
Sergey Tkachenko |
Posted: 11/26/2003 21:28:23 Your code is correct, assuming that rvoTagsArePChars is NOT included in rveMain.Options (otherwise tag value -1 passed in AddNLWTag would be incorrect and can cause AV). Format is not required after ApplyTextStyle, but it is not an error. Please create a small project reproducing the problem and send it to me. > > I'm trying to use a TRichViewEdit in the simplest possible way: add text > to it, then change the style of selected text. I'm using Unicode > settings. Adding text to the component works fine, but as soon as I > select some text and try to change the style by setting it to one of the > styles in my associated TRVStyle, I get an AV. This is all the code I have: > > procedure TfrmMain.ChangeStyle; > begin > rveMain.ApplyTextStyle(4); > rveMain.Format; > end; > > procedure TfrmMain.btnAddTextClick(Sender: TObject); > begin > rveMain.AddNLWTag('This is a test project. ', > 0, -1, -1); > rveMain.Format; > end; > > procedure TfrmMain.FormClose(Sender: TObject; var Action: TCloseAction); > begin > rveMain.Clear; > end; > > procedure TfrmMain.btnTSTClick(Sender: TObject); > begin > ChangeStyle; > end; > > I'm using Delphi 5 on Windows 2000, and I have Unicode set to True for > all text styles. This is driving me nuts. Any ideas? > > Cheers, > Martin > |
Powered by ABC Amber Outlook Express Converter