Search the Community
Showing results for tags 'twain_getdefaultsourcename'.
-
I'm trying to verify which is the default scanner and if it is different from what I need to propose a choice among those available. All this is possible with eztw32.dll however I can not make certain functions work Are these: int TWAIN_GetDefaultSourceName(LPSTR pzName) string TWAIN_DefaultSourceName() int TWAIN_GetSourceList(void) source: http://www.eztwain.com/pub/eztp/EZTwain_User_Guide.pdf I tried this way but they do not work: Local $pzName $pzName = DllCall($pathDLL,"int","TWAIN_DefaultSourceName") ; $rc = DllCall($pathDLL,"int","TWAIN_GetDefaultSourceName", "str*", $pzName) ; $rc = DllCall($pathDLL,"int","TWAIN_GetDefaultSourceName","str", $pzName) ; $rc = DllCall($pathDLL,"int","TWAIN_GetSourceList") $rc = DllCall($pathDLL,"int","TWAIN_GetSourceList", "NONE", "") ; Can anyone help me? Everything else works, here is the code: Local $pathDLL = @ScriptDir&"\_res\eztw32.dll" Local $rc = DllCall($pathDLL,'int','TWAIN_EasyVersion') if @error <> 0 then MsgBox(16+262144, "DllCall Error", "Error load eztw32.dll") else ConsoleWrite('--> eztw32.dll version: ' & $rc[0]/100 & @CRLF) $rc = DllCall($pathDLL,"int","TWAIN_IsAvailable") If @error > 0 Then MsgBox(16+262144, "DllCall Error", "Error call DLL - TWAIN_IsAvailable") if $rc[0] <> 0 then ConsoleWrite('--> TWAIN available: RC = ' & $rc[0]&@CRLF) ;;;;;;;;;;;;;;;;;;;;;; I NEED HERE ;manual select scanner Local $hwnd $rc = DllCall($pathDLL,"long","TWAIN_SelectImageSource",'hwnd',$hwnd) ConsoleWrite('--> TWAIN_SelectImageSource = ' & $rc[0]&@CRLF) if $rc[0] <> 0 then ConsoleWrite("--> TWAIN device selected"&@CRLF) else ConsoleWrite("--> no TWAIN device selected"&@CRLF) endif Else ConsoleWrite('--> TWAIN NOT available: RC = ' & $rc[0]&@CRLF) ; es: 0 endif endif thank you