Recent

Author Topic: RichMemo Errors  (Read 355 times)

Raf20076

  • Full Member
  • ***
  • Posts: 153
    • https://github.com/Raf20076
RichMemo Errors
« on: November 18, 2022, 05:55:57 pm »
Lazarus 2.2.4 RichMemo from lazarus-ccr-svn-r8628, Windows 7, 32bit

Hi guys

I've got some errors from RichMemo, when I compile richmemopackage.lpk (unit Win32RichMemoProc;  ) . Have got any ideas? Thanks

Code: Pascal  [Select][+][-]
  1. win32richmemoproc.pas(812,22) Error: Incompatible types: got "<address of function(PDWord;PByte;LongInt;var LongInt):DWord;StdCall>" expected "<procedure variable type of function(LongWord;PByte;LongInt;var LongInt):DWord;StdCall>"
  2. win32richmemoproc.pas(784,22) Error: Incompatible types: got "<address of function(PDWord;PByte;LongInt;var LongInt):DWord;StdCall>" expected "<procedure variable type of function(LongWord;PByte;LongInt;var LongInt):DWord;StdCall>"


jamie

  • Hero Member
  • *****
  • Posts: 5045
Re: RichMemo Errors
« Reply #1 on: November 18, 2022, 06:36:54 pm »
I think there was some talk about that not working.

Have you tried to download the package from the online package manager?
The only true wisdom is knowing you know nothing

Raf20076

  • Full Member
  • ***
  • Posts: 153
    • https://github.com/Raf20076
Re: RichMemo Errors
« Reply #2 on: November 20, 2022, 04:20:22 pm »
OK I have found this patch for this problem. I don't know if it works from here https://forum.lazarus.freepascal.org/index.php?topic=51914.0

The thing is that someone should fix this problem.

This is what is in patch

Code: Pascal  [Select][+][-]
  1. --- win32/win32richmemo.pas     Sun Sep 06 09:11:18 2020
  2. +++ win32/win32richmemo.pas     Tue Oct 27 09:40:56 2020
  3. @@ -1639,8 +1639,8 @@
  4.    end;
  5.    PStreamText = ^TStreamText;
  6.  
  7. -{$IF FPC_FULLVERSION>=30301}
  8. -function Read(dwCookie:DWORD_PTR; pbBuff:LPBYTE; cb:LONG; var pcb:LONG):DWORD; stdcall;
  9. +{$IF FPC_FULLVERSION>=30200}
  10. +function Read(dwCookie:DWORD; pbBuff:LPBYTE; cb:LONG; var pcb:LONG):DWORD; stdcall;
  11.  {$ELSE}
  12.  function Read(dwCookie:PDWORD; pbBuff:LPBYTE; cb:LONG; var pcb:LONG):DWORD; stdcall;
  13.  {$ENDIF}
  14. --- win32/win32richmemoproc.pas Sun Sep 06 09:11:18 2020
  15. +++ win32/win32richmemoproc.pas Tue Oct 27 09:40:55 2020
  16. @@ -758,8 +758,8 @@
  17.      pfnCallback : EDITSTREAMCALLBACK;
  18.    end;
  19.    
  20. -{$IF FPC_FULLVERSION>=30301}
  21. -function RTFLoadCallback(dwCookie:DWORD_PTR; pbBuff:LPBYTE; cb:LONG; var pcb:LONG):DWORD; stdcall;
  22. +{$IF FPC_FULLVERSION>=30200}
  23. +function RTFLoadCallback(dwCookie:DWORD; pbBuff:LPBYTE; cb:LONG; var pcb:LONG):DWORD; stdcall;
  24.  {$ELSE}
  25.  function RTFLoadCallback(dwCookie:PDWORD; pbBuff:LPBYTE; cb:LONG; var pcb:LONG):DWORD; stdcall;
  26.  {$ENDIF}
  27. @@ -786,8 +786,8 @@
  28.    Result := cbs.dwError = 0;
  29.  end;
  30.  
  31. -{$IF FPC_FULLVERSION>=30301}
  32. -function RTFSaveCallback(dwCookie:DWORD_PTR; pbBuff:LPBYTE; cb:LONG; var pcb:LONG):DWORD; stdcall;
  33. +{$IF FPC_FULLVERSION>=30200}
  34. +function RTFSaveCallback(dwCookie:DWORD; pbBuff:LPBYTE; cb:LONG; var pcb:LONG):DWORD; stdcall;
  35.  {$ELSE}
  36.  function RTFSaveCallback(dwCookie:PDWORD; pbBuff:LPBYTE; cb:LONG; var pcb:LONG):DWORD; stdcall;
  37.  {$ENDIF}
  38.  
  39.  

Is anyone who can fix RichMemo packet analyzing above patch? Thanks

Thaddy

  • Hero Member
  • *****
  • Posts: 12552
Re: RichMemo Errors
« Reply #3 on: November 21, 2022, 03:51:45 pm »
That patch is incorrect. The version should be compared with < or <=, not simply = which ties it to a *specific* version,in this case even a development version. Or with reverse logic >=,>
As is, I think this will never be accepted.
« Last Edit: November 21, 2022, 03:58:20 pm by Thaddy »
Writing code in an overly complex way is usually merely a complete misunderstanding of the goal you are trying to achieve.

rvk

  • Hero Member
  • *****
  • Posts: 5069
Re: RichMemo Errors
« Reply #4 on: November 21, 2022, 04:11:18 pm »
That patch is incorrect. The version should be compared with < or <=, not simply = which ties it to a *specific* version,in this case even a development version. Or with reverse logic >=,>
As is, I think this will never be accepted.
The patch has this:
{$IF FPC_FULLVERSION>=30200}
(where it was this previously: {$IF FPC_FULLVERSION>=30301})

How is this specific to a version?
Or am I missing something?


 

TinyPortal © 2005-2018