Using a DLL

Just starting out? Need help? Post your questions and find answers here.
yashaa
User
User
Posts: 19
Joined: Sun Jun 12, 2005 8:19 pm

Using a DLL

Post by yashaa »

Hello, I've found a dll, can someone give me a hint on how can I use the relative commands? (I have no experience using dll's... :oops: )

thankyou very much
xgp
Enthusiast
Enthusiast
Posts: 128
Joined: Mon Jun 13, 2005 6:03 pm

Post by xgp »

You have to read the dll documention to know the commands avaliable and parameters.
After that, use Library functions(OpenLibrary, CallFunction...)
Hope to be usefull.

xgp
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

hi @yashaa

1. Loading the DLL with 'OpenLibrary'

Code: Select all

dymodllname$="labels.dll"
dymodll=OpenLibrary(#PB_Any,dymodllname$)
If dymodll=0
  MessageRequester(dymodllname$,"required DLL is missing")
  End
EndIf
2. The Command 'Callfunction'

Code: Select all

If CallFunction(dymodll,"ReadLabelFile",LabelFile$)
    CallFunction(dymodll,"SetZoom",100)
    CallFunction(dymodll,"SetShadow",0)
    CallFunction(dymodll,"GetLabelInfo",Label.LABELINFO)
EndIf
but i would prefer reading the manual first :lol:
yashaa
User
User
Posts: 19
Joined: Sun Jun 12, 2005 8:19 pm

Post by yashaa »

Thanks :)
Is there a way to examine a dll and know all the commands?
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Post by ABBKlaus »

of course whith the following commands :
ExamineLibraryFunctions(#Library)
NextLibraryFunction()
ResultName$ = LibraryFunctionName()
ResultAdress.l = LibraryFunctionAddress()
Result.l = IsFunction(#Library, FunktionsName$)

and an example (i now there is a better one around here but i can´t find it right now :( )

Code: Select all

Gina=OpenLibrary(#PB_Any,"MSGINA.DLL")
Debug Gina
Debug CountLibraryFunctions(Gina)
If ExamineLibraryFunctions(Gina)
  While NextLibraryFunction()
    Name$ = LibraryFunctionName()
    Adr.l = LibraryFunctionAddress()
    Debug RSet(Hex(Adr),10,"0")+" "+Name$
  Wend
EndIf
Post Reply