Page 1 of 1

Updated TRichView, new TRVAnsiString parameters

Posted: Mon Oct 05, 2009 12:48 pm
by martindholmes
Hi there,

I've just updated my TRichView to the latest version in Delphi 2005, and I find that a lot of my calls to TRichView functions, passing string parameters, result in errors because the RichView functions are now expecting TRVAnsiString parameters. Should I just change all my string parameters to TRVAnsiStrings in Delphi 2005?

Cheers,
Martin

Posted: Mon Oct 05, 2009 3:30 pm
by Sergey Tkachenko
There are only a few methods that exist only in AnsiString form.
The most of methods have -A form (AnsiString), -W form (Unicode) and a default form (Ansi for D3-D2007, Unicode for D2009-D2010).
For example, SearchTextA has AnsiString parameter, SearchTextW has WideString/UnicodeString parameter, SearchText has String parameter.

The preferred solution is changing all methods to default methods accepting String parameters.
Details are here: http://www.trichview.com/help/new_in_version_11.html

Posted: Tue Oct 06, 2009 12:35 pm
by martindholmes
Hi there,

I'm not sure what to do in a situation like GetPictureInfo, though:

procedure GetPictureInfo(ItemNo: Integer; var AName: TRVAnsiString;
var Agr: TGraphic; var AVAlign: TRVVAlign;
var ATag: Integer);

Passing a string in as AName causes an error; should I be changing my parameter to a TRVAnsiString, or is there a GetPictureInfoA version of the function?

Cheers,
Martin

Posted: Tue Oct 06, 2009 2:47 pm
by Sergey Tkachenko
In this case, change the type of the parameter to TRVAnsiString.
Names of non-text items are (almost) the only strings that were left in ANSI.