Trouble calling a DLL

Discussions about the Liberty BASIC language, with particular reference to LB Booster
milfredo
Posts: 1
Joined: Fri May 25, 2018 9:15 pm

Trouble calling a DLL

Post by milfredo »

I am writing a program using Liberty Basic and thought I'd see how things might be using LBB.

Here is a snippet of code....

Open "IsFile32.dll" For DLL As #ff
CallDLL #ff, "IsFile",temp$ As ptr, result As long
close #ff

I get an error code when I try and run the program, saying that the DLL is not available. I put the IsFile32.dll in the same folder as the LBB application. So not sure what the problem happens to be.

Any help would be appreciated.

Milfredo
Ivega718
Posts: 2
Joined: Sun Jun 17, 2018 4:27 pm

Re: Trouble calling a DLL

Post by Ivega718 »

You can explicitly put the path and file of DLL and test. May be this can help.

Sample:

Open "C:\BBCBASIC\LIB\IsFile32.dll" FOR DLL AS #FF
Ivega718
Posts: 2
Joined: Sun Jun 17, 2018 4:27 pm

Re: Trouble calling a DLL

Post by Ivega718 »

Also you can test with BBC BASIC code in LBBOOSTER:

Code: Select all

!SYS "LoadLibrary", "IsFile32.dll" TO MyDll%
!PRINT MyDll%
!ff=MyDll%
ff now have the MyDll% value in LBB

If MyDll% return a number more great than 0 then DLL is load