Hi, I am having trouble getting a
PureBasic created dll from the tutorial found here:
Tutorial
I have the
exact code that was posted in the tutorial in PureBasic and have built the all targets and it was successfully done it says. But when I set the code in AGK2 the way it is posted I get the following 2 errors depending on what I call the dll in PureBasic project settings
(Window.dll or
Windows64.dll) I have AGK2 set to create
64 bit programs and I am using
PureBasic 6.10 beta 2 64 bit on
Windows 10
I get the following error in AGK2 when dll is named "
Windows64.dll" in the PB project settings.
Failed to load "0" function from plugin "Listy"
Following error in AGK2 when dll is named "
Windows.dll"
Failed to load plugin 'Listy" required by this app, it may not be available for this platform.
Plugin is called "
Listy"
Code is the same for both file names in both PureBasic and AGK2
PureBasic code:
PrototypeC _GetAGKFunction(Function.p-ascii)
ProcedureCDLL ReceiveAGKPtr(*GetFunction)
GetAGKFunction._GetAGKFunction=*GetFunction
EndProcedure
ProcedureCDLL ListyFunction()
MessageRequester("PureBasic", "Hello from a PB plugin", #PB_MessageRequester_Info)
EndProcedure
AGK2 code:
// Project: Listy
// Created: 2024-01-17
// show all errors
SetErrorMode(2)
#Import_Plugin Listy
// set window properties
SetWindowTitle( "Listy" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
Listy.ListyFunction()
do
Print( ScreenFPS() )
Sync()
loop
Commands.txt:
#CommandName,ReturnType,ParameterTypes,Windows,Linux,Mac,Android,iOS,Windows64
ListyFunction,0,0,ListyFunction,0,0,0,0,0,ListyFunction,0,0,0,0,0,ListyFunction,0,0,0,0,0,ListyFunction,0,0,0,0,0,ListyFunction,0,0,0,0,0,ListyFunction,0,0,0,0,0
ASRock motherboard/ AMD 4.1 Ghtz Duel core/16GB Ram/Nvidia Geforce 1080 GTX 8GB/1TB Western Dig. SSD/Windows 10 Home/Dark Basic Pro 9Ex/AGK2/AGKStudio
No one cares how much you know until they know how much you care.