BassModDLL Import to PureLib
BassModDLL Import to PureLib
How do i go about this?
- tinman
- PureBasic Expert

- Posts: 1102
- Joined: Sat Apr 26, 2003 4:56 pm
- Location: Level 5 of Robot Hell
- Contact:
Write a ".pbl" file which is basically the names of the functions in the DLL as a text file. The exact format is in the readme for the DLL import tool I think.
Then run the DLL import tool and copy the PureLibrary to your PureLibraries directory somewhere.
If there are lots of functions and you cannot be bothered doing it by hand there are tools such as pexports and impdef which you can find links for here. You still need to manually edit the files to get them into the correct format though.
Alternatively, the user VPureBasic has a small tool which can extract the information in the correct format. It also sounds like Fred is doing something like that for the future too.
Then run the DLL import tool and copy the PureLibrary to your PureLibraries directory somewhere.
If there are lots of functions and you cannot be bothered doing it by hand there are tools such as pexports and impdef which you can find links for here. You still need to manually edit the files to get them into the correct format though.
Alternatively, the user VPureBasic has a small tool which can extract the information in the correct format. It also sounds like Fred is doing something like that for the future too.
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
(WinXPhSP3 PB5.20b14)
Thanks for teh reply, ive read most documentation i could find i have 1 problem tough. in the pbl files we have functions right. now look @ this example
BASSMOD.dll
BASSMOD_ErrorGetCode DATA
the above is the output i received from pexport, the data should be a integer that will be passed onto the dll, so will someone plz explain howto exactly write this into the pbl file....
BASSMOD.dll
BASSMOD_ErrorGetCode DATA
the above is the output i received from pexport, the data should be a integer that will be passed onto the dll, so will someone plz explain howto exactly write this into the pbl file....
-
FloHimself
- Enthusiast

- Posts: 229
- Joined: Wed May 14, 2003 3:38 pm
- Location: Lüneburg - Germany
from readme.txt:
then follows each function name with the number of parameters.
so the pbl for bassmod should look like: (NOT TESTED YET!)
first line is the name of the dll file.I. 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.
then follows each function name with the number of parameters.
so the pbl for bassmod should look like: (NOT TESTED YET!)
BASSMOD.DLL
BASSMOD_GetVersion 0
BASSMOD_GetDeviceDescription 1
BASSMOD_ErrorGetCode 0
BASSMOD_Init 3
BASSMOD_Free 0
BASSMOD_GetCPU 0
BASSMOD_SetVolume 1
BASSMOD_GetVolume 0
BASSMOD_MusicLoad 5
BASSMOD_MusicFree 0
BASSMOD_MusicGetName 0
BASSMOD_MusicGetLength 1
BASSMOD_MusicPlay 0
BASSMOD_MusicPlayEx 3
BASSMOD_MusicSetAmplify 1
BASSMOD_MusicSetPanSep 1
BASSMOD_MusicSetPositionScaler 1
BASSMOD_MusicIsActive 0
BASSMOD_MusicStop 0
BASSMOD_MusicPause 0
BASSMOD_MusicSetPosition 1
BASSMOD_MusicGetPosition 0
BASSMOD_MusicSetSync 4
BASSMOD_MusicRemoveSync 1
I created my own pbl file
i imported the lib, certain files were created but 1 problem, i can't use teh cmd's internaly because they are not recognized. and yes i restarted PB
Code: Select all
BASSMOD.dll
BASSMOD_ErrorGetCode 0
BASSMOD_Free 0
BASSMOD_GetCPU 0
BASSMOD_GetDeviceDescription 1
BASSMOD_GetVersion 0
BASSMOD_GetVolume 0
BASSMOD_Init 3
BASSMOD_MusicFree 0
BASSMOD_MusicGetLength 1
BASSMOD_MusicGetName 0
BASSMOD_MusicGetPosition 0
BASSMOD_MusicIsActive 0
BASSMOD_MusicLoad 5
BASSMOD_MusicPause 0
BASSMOD_MusicPlay 0
BASSMOD_MusicPlayEx 3
BASSMOD_MusicRemoveSync 1
BASSMOD_MusicSetAmplify 1
BASSMOD_MusicSetPanSep 1
BASSMOD_MusicSetPosition 1
BASSMOD_MusicSetPositionScaler 1
BASSMOD_MusicSetSync 4
BASSMOD_MusicStop 1
BASSMOD_SetVolume 1-
FloHimself
- Enthusiast

- Posts: 229
- Joined: Wed May 14, 2003 3:38 pm
- Location: Lüneburg - Germany
Ok, I assume that you have pointed the DLL-IMPORTER to the PureLibrary Path correctly.
Next step is to copy the BASSMOD.DLL to the [YOUR_PUREBASIC_PATH]\Compilers\ path, so the compiler can find the dll when hitting compile / run from Purebasic Editor.
Then you can call the functions from dll like WIN API functions.
Try:
Edit: btw: check your pbl file!
Next step is to copy the BASSMOD.DLL to the [YOUR_PUREBASIC_PATH]\Compilers\ path, so the compiler can find the dll when hitting compile / run from Purebasic Editor.
Then you can call the functions from dll like WIN API functions.
Try:
Code: Select all
Debug BASSMOD_ErrorGetCode_() ;should return 0 hereshould be:BASSMOD_MusicStop 1
BASSMOD_MusicStop 0