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 / Plugins DLL

Author
Message
Arbrakan
13
Years of Service
User Offline
Joined: 10th Oct 2010
Location: Geneva
Posted: 23rd May 2017 19:54
There is a way to create plugins for AppGameKit in PureBASIC ?

Quote: "Building a DLL
PureBasic allows to create standard Microsoft Windows DLL (Dynamic Linked Library), shared objects (.so) on Linux, and dynamic libraries (.dylib) on MacOS X. The DLL code is like a PureBasic code excepts than no real code should be written outside of procedure.

When writing a DLL, all the code is done inside procedures. When a procedure should be public (ie: accessible by third programs which will use the DLL), the keyword ProcedureDLL (or ProcedureCDLL if the procedure needs to be in 'CDecl' format, which is not the case of regular Windows DLL) is used instead of Procedure (and DeclareDLL or DeclareCDLL if are used instead of Declare). This is the only change to do to a program.

When this is done, select 'Shared DLL' as output format ('Compiler Option' window in the PureBasic editor or /DLL switch in command line) and a DLL with the name you set (in the save-requester when using the IDE) will be created in the selected directory.

Example

ProcedureDLL MyFunction()
MessageRequester("Hello", "This is a PureBasic DLL !", 0)
EndProcedure

; Now the client program, which use the DLL
;
If OpenLibrary(0, "PureBasic.dll")
CallFunction(0, "MyFunction")
CloseLibrary(0)
EndIf

For advanced p"


You can create a DLL in PureBASIC, but on AppGameKit they ask to write the text DLL_EXPORT before the function, but in PureBASIC I get an error, obviously...

Quote: "Any functions that you create in the plugin that you want to be accessible to AppGameKit must start with the text DLL_EXPORT like so

DLL_EXPORT void SetI( int value )
{
i = value;
}
"


Thanks for the help.
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 23rd May 2017 22:07 Edited at: 23rd May 2017 22:07
Arbrakan
13
Years of Service
User Offline
Joined: 10th Oct 2010
Location: Geneva
Posted: 23rd May 2017 22:08
woot so nice, thanks !

Login to post a reply

Server time is: 2024-03-29 12:52:32
Your offset time is: 2024-03-29 12:52:32