Page 1 of 1

Using a DLL

Posted: Mon Jul 11, 2005 4:55 pm
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

Posted: Mon Jul 11, 2005 5:01 pm
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

Posted: Mon Jul 11, 2005 5:06 pm
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:

Posted: Mon Jul 11, 2005 5:41 pm
by yashaa
Thanks :)
Is there a way to examine a dll and know all the commands?

Posted: Mon Jul 11, 2005 5:56 pm
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