DLL Import in PB

Just starting out? Need help? Post your questions and find answers here.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

Hi everybody.

I tried the following DLL work in PB, but if I call the DLL-Commands PB Crashes without giving an error.

The DLL+ Source and documentation is available here: http://www.esquadro.com.br/md5bas.zip

and that is my source:

Code: Select all

res=OpenLibrary(0,"aamd532.dll")

; Check if function is available

If IsFunction(0,"MDFile")>0
  MessageRequester("","Command found!",0)
EndIf

*pointer=CallFunction(0,"MDFile","c:\ntdetect.com") ; Crashes, but why!?

MessageRequester("",PeekS(*pointer),0)

CloseLibrary(0)
Anyone can help?

Cheers Mike

Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
System: Windows 2000 Server, 512 MB Ram, GeForce4200 TI 128 MB DDR, Hercules Theater 6.1 DTS Sound
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Rings.

Code: Select all

res=OpenLibrary(0,"c:\aamd532.dll")If Res
 If IsFunction(0,"MDFile")>0
  Filename.s="c:\8.zip"
  Back.s=Space(255)
  pointer=CallFunction(0,"MDFile",@[url]mailto:Filename,@Back.s[/url])
  MessageRequester("Result is",Back.s,0)
  End
 EndIf 
 CloseLibrary(0)
EndIf
Beep_(100,100)
End
read the docs carefully Mike!(you need more space :) )

and cheers !

Its a long way to the top if you wanna .....CodeGuru
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by tranquil.

Hi Rings!

You are totaly right! uaarr.. I suggested that CallFunction gives back the result. Works fine!

Thanks a lot, thousend kisses. :))))

Mike

Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User
System: Windows 2000 Server, 512 MB Ram, GeForce4200 TI 128 MB DDR, Hercules Theater 6.1 DTS Sound
Post Reply