Recent

Author Topic: Windows 7 Cross.Codebot wont compile  (Read 1266 times)

TheLastCayen

  • Jr. Member
  • **
  • Posts: 81
Windows 7 Cross.Codebot wont compile
« on: November 07, 2019, 10:08:48 pm »
Hi,

I am using:
 - Lazarus 2.0.6 64bit
 - FPC  3.0.4
 - Windows 7 64bit
 - sysrpl/Cross.Codebot last version in date of 11/07/2019

Codebot works well for my Linux laptop but I am not able to compile codebot.lpk and codebotctrls.lpk under windows 7 64bit to port my application.

error message:
codebot.interop.windows.gdiplus.pas(11906,45) Error: Can't determine which overloaded function to call

This is the line with the error code:
B := TGdiBitmap.Create(Size * 2, Size * 2);

I don't need that component so if I comment on the size( B := TGdiBitmap.Create;//(Size * 2, Size * 2); ), I end up with that error message:
codebot.forms.management.pas(24,20) Error: Forward declaration not solved "class GetCurrent:TCustomForm; Static;"

Most of the code in this file is not available due to Line 35: {$if defined(linux) and defined(lclgtk2)}. I also Don't need that file, to be honest, I only need codebot.input.hotkeys.pas.

Codebot is still supported for windows? If not anyone knows an alternative package that can support keyboard hook with different operating systems?

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: Windows 7 Cross.Codebot wont compile
« Reply #1 on: November 08, 2019, 12:42:33 am »
Compiler bug, its an obvious thing it should know but it does not. Its been reported many times before. It's type results switching and the compiler knows at one point what it should be but then has a another scenario which most likely is wrong but then decides to stop and give you that error.

 I don't know what type "Size" is but try to type cast the equation within the call parameters or do the math outside of the call parameters because the compiler is switching types when doing math within the parameter call.

 so try something like this..
 
  (Word(Size * 2));

or cast it to what ever the type SIZE is. because if size is a BYTE, WORD things turn into a Integer etc.

 This may have been fixed already in newer releases of the compiler but still exists in 3.0.4
give it a try..
The only true wisdom is knowing you know nothing

TheLastCayen

  • Jr. Member
  • **
  • Posts: 81
Re: Windows 7 Cross.Codebot wont compile
« Reply #2 on: November 08, 2019, 11:11:52 pm »
Thank you Jamie.

B := TGdiBitmap.Create(Word(Size * 2), Word(Size * 2));

fix the first issue.

I am still stuck with Cross.Codebot-master\source\codebot.forms.management.pas missing the procedures/functions for windows. :(    If I comment everything in that file, I end up with the same kind of issue with Cross.Codebot-master\source\codebot.forms.floating.pas

Did anyone found a way to bypass the issue?

jamie

  • Hero Member
  • *****
  • Posts: 6077
Re: Windows 7 Cross.Codebot wont compile
« Reply #3 on: November 08, 2019, 11:22:08 pm »
I don't know what to tell you, sounds to me you have a specific project for Linux!

The LCLIntf unit has cross over functions but I can't say it's going to solve your issues?
The only true wisdom is knowing you know nothing

TheLastCayen

  • Jr. Member
  • **
  • Posts: 81
Re: Windows 7 Cross.Codebot wont compile
« Reply #4 on: November 08, 2019, 11:59:47 pm »
I am doing a cross-platform application that can intercept keypress when the application is minimized.  Example: start an action when F5 is press. I was using Cross.Codebot-master because the author claim it's cross-platform and to be honest the code is really simple and efficient under Linux. I also know the creator of the project is subscribe to this Forum and he seems to reply to those questions time to time... But like everyone, he is probably busy at the moment. Can't blame me to take a chance;)

I know windows API can also do it but I was not able to find an alternative for Linux without that package. So now I am looking what are my option before I go too far with the project:)


 

TinyPortal © 2005-2018