Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [SOLVED] AGK 2 Plugin

Author
Message
TheLion
19
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 7th Mar 2024 19:58
Hi, I keep getting the following error message when trying to load a plugin, Has anyone any ideas as to why?

" Failed to load plugin 'MyPlugin' required by this app,it may not be available for this platform"

regards Leo

PS The first plugin wrote worked a treat but, after that I just get the same message even with the one that worked first! the plugin is wrote in Delphi 7 and I have the following function

// **** Needed For AGK2 to make plugin work ****
function ReceiveAGKPtr(): Integer; stdcall;
begin
end;

The author of this post has marked a post as an answer.

Go to answer

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 7th Mar 2024 20:43
I think u'll get that msg if ur app is 32 bit and the plugin 64 bit or vice versa so make sure those match (we can tick 64 bit builds (or not) in the geany ide).
TheLion
19
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 7th Mar 2024 21:15
Thanks Virtual Nomad

I've just ported to Delphi 11 and recompiled the DLL to 64bit, set AGK2 to 64bit too. Still the same message. I am at a lose as what is causing this error.

PS same error on my laptop.

Cheers Leo
adambiser
AGK Developer
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 8th Mar 2024 03:19
Your ReceiveAGKPtr signature doesn't look correct to me.
In C++ it's:


Maybe this?
TheLion
19
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 8th Mar 2024 20:07
This post has been marked by the post author as the answer.
Thanks adambiser !

Doff my cap to you mate, respect!

It was the pointer function, it should have been along these lines below.

// **** Needed For AGK2 to make plugin work ****
function ReceiveAGKPtr(): longint; stdcall;
begin
end;

Although longint is a signed 32bit word it still works, will change this to unsigned longword.

thanks again

Leo
adambiser
AGK Developer
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 9th Mar 2024 01:05
Haven't looked at Delphi in ages, but aren't you declaring ReceiveAGKPtr to be a function that returns a longint? ReceiveAGKPtr doesn't return anything, but receives the pointer...
TheLion
19
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 9th Mar 2024 09:43
Yes, the routine will not return anything unless I place a return value like below

function ReceiveAGKPtr(): Pointer; stdcall;
begin
ReceiveAGKPtr:= " A Value to return"
end;

Leo
adambiser
AGK Developer
8
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 10th Mar 2024 01:57
Let me reword. ReceiveAGKPtr isn't supposed to return anything. It is a void function. Instead, it should receive the pointer as its first argument.

Login to post a reply

Server time is: 2024-04-27 18:30:28
Your offset time is: 2024-04-27 18:30:28