can't install RichViewActionsD5.dpk

General TRichView support forum. Please post your questions here
Post Reply
lwinter
Posts: 24
Joined: Thu Dec 01, 2005 4:42 am

can't install RichViewActionsD5.dpk

Post by lwinter »

- on windows vista
- re-install of everything after upgrade from XP to vista
- Delphi 5 installes and works ok on vista
- rich view components were working ok previously on XP
- followed all prerequisite install steps by the letter
- compile errors with "Undeclared identifier"s

?
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

What versions of TRichView and RichViewActions do you have?
lwinter
Posts: 24
Joined: Thu Dec 01, 2005 4:42 am

Post by lwinter »

Sergey Tkachenko wrote:What versions of TRichView and RichViewActions do you have?
richView 1.9.21
htmlImport 0.0019
addict3 3.4.4
richViewActions 1.52.1

I'm reluctant to upgrade to later versions, as we needed to make customisations to CRVData.pas and RVItem.pas (to do with importing and exporting items). These changes would need to be re-applied and require comprehensive regression-testing.

It would be an option though to do it all in one, and use the switch to Vista to upgrade to Delphi 11 / 2007, while at the same time upgrading to the latest versions of richView, htmlImporter, addictSpellChecker and richViewActions - provided stable versions of each of these are available for Delphi 11 on Vista.

Thanks,
-- Lutz
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I think you need older version of RichViewActions for TRichView 1.9.21, but unfortunately I do not have it.
Please tell me what exactly errors the compiler generates while compiling RichViewActions. May be I will be able to suggest how to modify RichViewActions to compile them with TRichView 1.9.21

(you can select error message in Delphi Message window and press Ctrl+C. Error message will be copied to the Clipboard)
lwinter
Posts: 24
Joined: Thu Dec 01, 2005 4:42 am

Post by lwinter »

The same configuration did compile on Windows XP. Attempt to compile RichViewActionsD5.dpk on Vista gives:

----------------------------------------------

[Error] RichViewActions.pas(3021): Undeclared identifier: 'OnCurTextStyleChanged'

[Error] RichViewActions.pas(3021): Incompatible types

...

[Error] RichViewActions.pas(3023): Undeclared identifier: 'OnCurParaStyleChanged'

[Error] RichViewActions.pas(3023): Incompatible types

...

[Error] RichViewActions.pas(9127): Undeclared identifier: 'TRVDeleteUnusedStylesData'

[Error] RichViewActions.pas(9155): Missing operator or semicolon

[Error] RichViewActions.pas(9155): Incompatible types: 'TComponent' and 'Boolean'

[Error] RichViewActions.pas(9157): Not enough actual parameters

[Error] RichViewActions.pas(9160): ')' expected but identifier 'UsedListStyles' found

[Error] RichViewActions.pas(9166): Missing operator or semicolon

...

[Error] RichViewActions.pas(9414): ')' expected but identifier 'UsedListStyles' found

[Error] RichViewActions.pas(9419): Missing operator or semicolon

----------------------------------------------

I left out repeated errors occuring in multiple spots.

Also, I'm not sure if this could be a related problem:
When I open RichViewActionsD5.dpk with Delphi 5 not running, then I get an access violation error (can't access CorIde50.bpl).
When I open RichViewActionsD5.dpk with Delphi 5 running, then the package opens ok.
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

As for the first group of errors, as I understand, the following lines generate it:

Code: Select all

  if Assigned(rve.OnCurTextStyleChanged) then
    rve.OnCurTextStyleChanged(rve);
  if Assigned(rve.OnCurParaStyleChanged) then
    rve.OnCurParaStyleChanged(rve);
Change them to:

Code: Select all

  if Assigned(TRichViewEdit(rve).OnCurTextStyleChanged) then
    TRichViewEdit(rve).OnCurTextStyleChanged(rve);
  if Assigned(TRichViewEdit(rve).OnCurParaStyleChanged) then
    TRichViewEdit(rve).OnCurParaStyleChanged(rve);
As for the second group of errors. In the new version of TRichView, declaration of rve.RVData.MarkStylesInUse was changed.
In order to support older version, change in TrvActionParaList.ExecuteTarget:
1) in var declaration:
Data: TRVDeleteUnusedStylesData;
to
UsedTextStyles, UsedParaStyles, UsedListStyles: TRVIntegerList;
2) The following code fragment

Code: Select all

          Data := TRVDeleteUnusedStylesData.Create(False, False, True);
          try
            rve.RVData.MarkStylesInUse(Data);
            Index := -1;
            for i := 0 to rve.Style.ListStyles.Count-1 do
              if (Data.UsedListStyles[i]=0) and
                  rve.Style.ListStyles[i].IsSimpleEqual(ListStyle, False) then begin
                Index := i;
                break;
              end;
          finally
            Data.Free;
          end;
to

Code: Select all

          UsedTextStyles := TRVIntegerList.CreateEx(rve.Style.TextStyles.Count, 1);
          UsedParaStyles := TRVIntegerList.CreateEx(rve.Style.ParaStyles.Count, 1);
          UsedListStyles := TRVIntegerList.CreateEx(rve.Style.ListStyles.Count, 0);
          rve.RVData.MarkStylesInUse(UsedTextStyles, UsedParaStyles, UsedListStyles);
          UsedTextStyles.Free;
          UsedParaStyles.Free;
          Index := -1;
          for i := 0 to rve.Style.ListStyles.Count-1 do
            if (UsedListStyles[i]=0) and rve.Style.ListStyles[i].IsSimpleEqual(ListStyle, False) then begin
              Index := i;
              break;
            end;
          UsedListStyles.Free;
          UsedParaStyles.Free;
         UsedTextStyles.Free;
lwinter
Posts: 24
Joined: Thu Dec 01, 2005 4:42 am

Post by lwinter »

Thanks Sergey,
I have applied the code snippets to the appropriate spots in RichViewActions.pas and RVRuler.pas, and error messages have boiled down down to:

[Error] RVRuler.pas(252): Too many actual parameters

[Error] RVRuler.pas(357): Undeclared identifier: 'MarkStylesInUse'

The second error is a result of the new code snipped adapted to TRVRuler.DoIndentChanged:

Code: Select all

          UsedListStyles := TRVIntegerList.CreateEx(FRichViewEdit.Style.ListStyles.Count, 0);
          FRichViewEdit.MarkStylesInUse(UsedTextStyles, UsedParaStyles, UsedListStyles);
          UsedTextStyles.Free;
See the modified http://www.holocentric.com/downloads/code/RVRuler.pas

.. getting closer ...
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

The first error, as I understand, in call of FRichViewEdit.RVData.Format_.
Just remove last boolean parameters (one or more, I do not remember)

The second error, use FRichViewEdit.RVData.MarkStylesInUse, not FRichViewEdit.MarkStylesInUse.
lwinter
Posts: 24
Joined: Thu Dec 01, 2005 4:42 am

Post by lwinter »

Thanks - RichViewActionsD5.dpk now compiles and can be installed.

Odd thing though, that these modifications broke the project that I was working on. After installation of RichViewActionsD5.dpk, to be able to compile the actual project (which uses RichViewActions), I had to revert all code to exactly how it was before. Bit dodgy.

Thanks for your help anyway.
Post Reply