Since i didn't find a existing example i translated the available Functions to Autoit and made a little example on how to use it:
Code: Select all
Global $hDll_1SCDLL = DllOpen("1SCDLL.dll")
If Not ($hDll_1SCDLL = -1) Then
; Like: -connect localhost:64535 -passwd 8FE4C11451281C094A6578E6DDBF5EED
If _Start_Server("", "", "localhost", 64535, "8FE4C11451281C094A6578E6DDBF5EED", False, "", True) Then
ConsoleWrite("Call Succeded" & @LF)
Else
ConsoleWrite("Call Failed: " & @error & @LF)
EndIf
Else
MsgBox(0, "Error Title", "Error Text")
Exit -1
EndIf
#cs
1SCDLL.dll Helper Functions
a Succesfull 'Global $hDll_1SCDLL = DllOpen("1SCDLL.dll")' is Required
CallTips:
_Stop_Server()
_Start_Server($sID, $sRepeater, $sDirect, $iPort, $sPassword, $fProxy, $sClassname, $fHaveToWait)
Return Values:
True = Call Succeded
False = Call Failed
@error = 1 -> dll not Loaded
@error = 2 -> Error calling export function
#ce
Func _Start_Server($sID, $sRepeater, $sDirect, $iPort, $sPassword, $fProxy, $sClassname, $fHaveToWait)
If $hDll_1SCDLL > 0 Then
DllCall($hDll_1SCDLL, "none:cdecl", "Start_server", _ ; MY1SCDLL_API void Start_server(
"str", $sID, _ ; char *ID,
"str", $sRepeater, _ ; char *repeater,
"str", $sDirect, _ ; char *direct,
"int", $iPort, _ ; int port,
"str", $sPassword, _ ; char *passwd,
"int", $fProxy, _ ; bool proxy,
"str", $sClassname, _ ; char *classname,
"int", $fHaveToWait) ; bool have_to_wait);
If Not @error Then Return True
Else
Return SetError(1, 0, False)
EndIf
Return SetError(2, 0, False)
EndFunc ;==>_Start_Server
Func _Stop_Server()
If $hDll_1SCDLL > 0 Then
DllCall($hDll_1SCDLL, "none:cdecl", "Stop_server") ; MY1SCDLL_API void Stop_server();
If Not @error Then Return True
Else
Return SetError(1, 0, False)
EndIf
Return SetError(2, 0, False)
EndFunc ;==>_Stop_Server
Autoit does not have unique classnames so multiple running scripts would lead into trouble.
And my question is...
Is there any way to pass an window handle instead of the Classname?
Or something like this planned?
or do i have to find a solution for this problem on the AutoIt side (Like creating a window with a unique classname with api calls) ?
Thanks