trichview.com

trichview.support




Re: AV when load RTF file


Return to index


Author

Message

Sergey Tkachenko

Posted: 02/11/2003 19:44:41


You need to link RichView with some RVStyle object:


Example, creating a temporal RichView and converting RTF to HTML:


var

  InvisibleRichView: TRichView;

  RVStyle: TRVStyle;

begin

  InvisibleRichView := TRichView.Create(nil);

  RVStyle := TRVStyle.Create;

  try

    InvisibleRichView.Visible := False;

    InvisibleRichView.Parent := RTFForm;

    InvisibleRichView.Style := RVStyle;

    InvisibleRichView.RTFReadProperties.TextStyleMode := rvrsAddIfNeeded;

    InvisibleRichView.RTFReadProperties.ParaStyleMode := rvrsAddIfNeeded;

    InvisibleRichView.LoadRTF('aaa.rtf');

    // InvisibleRichView.Format; // <- not required in this example;

    InvisibleRichView.SaveHmlEx('aaa.html', 'aaa', 'img', '', '', '', []);

  finally

    InvisibleRichView.Free;

    RVStyle.Free;

  end;



>

> I dynamically create a TRichView object and get an AV when I try to load

an

> RTF file.  Any suggestions?  Using trial version with D7 Pro.

>

> Code snippet:

>

> var

>   rv: TRichView;

> begin

>   rv := TRichView.Create( nil );

>   try

>     rv.LoadRTF('a.rtf'); // <---- AV here

>   finally

>     FreeAndNil( rv );

>   end;

> end;

>

> (I've also tried loading the RTF into a stream and use LoadRTFFromStream,

> but this also gives an AV.)

>

> Thanks,

> Neal





Powered by ABC Amber Outlook Express Converter