1. Introduction
PureBasic allows to uses external DLL as it was standard commands, with an trailing underscore (i.e. SendMessage_(), CreateWindowEx_()…).
Almost all the Win32 API is natively supported by PureBasic, and with this tool, it’s now possible to add your own dll or update the actual one.
2. Building a DLL Definition-File
The DLL definition file is a list of all the DLL functions you want to support in PureBasic. It’s plain ASCII and use a very easy format:
DLLNAME.DLL Function1 NbParameters Function2 NbParameters Function3 NbParameters ...
Comments are accepted, using the ';' character.
Example (which works with the DLLSample.pb example):
; PureBasic DLL import file ; PUREBASIC.DLL EasyRequester 1
Once the file is finished, just save it with the .pbl (PureBasic Library) extension.
3. Using DLL Importer with the GUI
-
Selects the
PureLibrariesdirectory. It’s located in the PureBasic folder and should contains aWindowsdirectory, inside which it should have aBin\BuildLib.exetool. This tool is needed to make the DLL, and it’s used internally by the DLL Importer. You don’t need to use it. -
Select the
PureDLLfolder. Just create a new folder and choose it. A drawer folderExportswill be created automatically if none are found.When the program quits, these settings are automatically saved. -
Now, you can select the .pbl file by clicking on ‘Start’. If you have lots of files to import, you can check the ‘Process whole directory’ checkbox and the all the .pbl files found in the
PureDLLfolder will be imported.
Contributing and Support
Feel free to contribute to this document by submitting your own fixes and improvements via Git and creating a pull request on the PureBasic Open Source repository:
If you have any questions, remarks or suggestions, just write to: <support@purebasic.com>.