Updated TRichView, new TRVAnsiString parameters

General TRichView support forum. Please post your questions here
Post Reply
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Updated TRichView, new TRVAnsiString parameters

Post 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
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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
martindholmes
Posts: 131
Joined: Mon Aug 29, 2005 12:03 pm

Post 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
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post 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.
Post Reply