topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday December 13, 2024, 11:31 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Delphi FARR Plugin SDK updates? or working example?  (Read 9795 times)

GameCat

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Delphi FARR Plugin SDK updates? or working example?
« on: April 09, 2013, 06:54 PM »
Does anyone have a working example of a FARR plugin for Delphi?

There is a Delphi FARR Plugin example in the SDK but it doesn't work when compiled with Delphi XE2. The example is a few years old and might have been written before Delphi added unicode support.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Delphi FARR Plugin SDK updates? or working example?
« Reply #1 on: April 09, 2013, 06:57 PM »
Can you try to update it GameCat?

GameCat

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Delphi FARR Plugin SDK updates? or working example?
« Reply #2 on: April 09, 2013, 06:59 PM »
I can but I don't know c++ so I will need some help/guidance.

GameCat

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Delphi FARR Plugin SDK updates? or working example?
« Reply #3 on: April 09, 2013, 07:02 PM »
Is there a guide to developering Farr plugins somewhere?




GameCat

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Delphi FARR Plugin SDK updates? or working example?
« Reply #4 on: April 09, 2013, 07:14 PM »
Progress so far:

- I've created a Farr plugin DLL.
- The DLL is loaded by FARR when FARR starts.

The Farr plugin error log shows:

09:31 AM, Wednesday, April 10, 2013
 Error initializing plugin do_init function
C:\Program Files (x86)\FindAndRunRobot\Plugins\FarrPluginTest\FarrPluginTest.dll

The do_init() function exported by my DLL is not being called. I'm guessing the method signiture of my exported function is incorrect?

My do_init() function is declared using:
type
  Fp_GetStrVal = function(JrPluginPointerp:Pointer; varname:PAnsiChar; destbuf:PAnsiChar; maxlen:integer):BOOL; cdecl;
  Fp_SetStrVal = function(JrPluginPointerp:Pointer; varname:PAnsiChar; strbuf:PAnsiChar):BOOL; cdecl;

function PluginFunc_DoInit(
  const fullfilename:PAnsiChar ;
  inhostptr:Pointer;
  const hostname:PAnsiChar;
  const hostversionstring:PAnsiChar;
  incallbackfp_GetStrVal:FP_GetStrVal;
  incallbackfp_SetStrVal:FP_SetStrVal
): BOOL; cdecl;




Is there a way to have more detailed information added to the plugin error log?




mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Delphi FARR Plugin SDK updates? or working example?
« Reply #5 on: April 09, 2013, 08:07 PM »
let me upload for you a current working plugin so you can get the most recent header files and stuff.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Delphi FARR Plugin SDK updates? or working example?
« Reply #6 on: April 09, 2013, 08:14 PM »
Here's the source for a recent plugin made with C++ Builder, the sister to Delphi:
https://www.donation.../PopQuotesSource.zip

It will have the most recent header files and functions wheras your delphi sample may be slightly old.

GameCat

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Delphi FARR Plugin SDK updates? or working example?
« Reply #7 on: April 09, 2013, 09:42 PM »
Thanks Mouser, taking a look now....

[some time later...]

From what I can see I've declared the PluginFunc_DoInit() correctly but I have very little experience translating C headers to Delphi so I could be wrong.

I've tried a few variations with no luck. My PluginFunc_DoInit() is never called when the DLL is loaded. The plugin error log reports the same error:

12:30 PM, Wednesday, April 10, 2013
 Error initializing plugin do_init function
C:\Program Files (x86)\FindAndRunRobot\Plugins\test\FarrLocate32.dll

Any ideas?


mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Delphi FARR Plugin SDK updates? or working example?
« Reply #8 on: April 12, 2013, 10:38 AM »
Let me go look at the old delphi stuff and the new changes to the plugin headers and see if i can't spot any needed changes.

Can you send me your latest delphi code and i'll try compiling it and experimenting with it?

GameCat

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Delphi FARR Plugin SDK updates? or working example?
« Reply #9 on: April 13, 2013, 06:10 PM »
I've attached my plugin code. The plugin only exports one function, PluginFunc_DoInit().

I'm using Delphi XE2 to compile the plugin. The example plugin in the SDK doesn't work either when compiled with Delphi XE2.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Delphi FARR Plugin SDK updates? or working example?
« Reply #10 on: April 13, 2013, 07:28 PM »
Got it, and i'll have a look.

Since I haven't said it yet let me say it now: Thank you so much for your patience and cheerful spirit about this -- i don't think i would be so understanding if i was in your shoes -- if you don't give up I promise I will make sure you have a working delphi plugin framework for farr.

GameCat

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Delphi FARR Plugin SDK updates? or working example?
« Reply #11 on: April 13, 2013, 10:27 PM »
Thanks for taking a look mouser. I'm in well over my head when it comes to translating headers. (I don't know enough c)

Since I haven't said it yet let me say it now: Thank you so much for your patience and cheerful spirit about this -- i don't think i would be so understanding if i was in your shoes -- if you don't give up I promise I will make sure you have a working delphi plugin framework for farr.

Not at all!! FARR is a great utility that I'm slowly using more. Its usefulness will increase if I can write small plugins as well. You taking a look at the delphi SDK is much more then I expected!


GameCat

  • Participant
  • Joined in 2013
  • *
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: Delphi FARR Plugin SDK updates? or working example?
« Reply #12 on: July 15, 2013, 12:49 AM »
Any updates on this?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Delphi FARR Plugin SDK updates? or working example?
« Reply #13 on: July 18, 2013, 12:20 PM »
Thank you for reminding me, I will try hard to get it done this weekend..