Re-4: using an ActiveX (twiz32.ocx) from runrev by vbs

runrev at animabit.de runrev at animabit.de
Fri Sep 26 03:55:54 EDT 2008


Hi Ken


BTW, I'm assuming you're talking about Rev 3, right? If not, let me know as
there's a couple of differences between VBS in Rev 2.x and Rev 3.


Thank you all for help - I use 2.9 and did not know that there are differences in handling of vbs in the new runrev 3.0.

I came to the following solution: instead of running vbs from runrev I use scan.hta (hyptertext application) with the code:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<title>Scannen</title>
<BODY onLoad="scanner.CurrentSource='2';scanner.ShowUI ='False';scanner.Units='2';scanner.Resolution = '150';scanner.ImageLeft='0';scanner.ImageRight='4';scanner.ImageBottom='4';scanner.AcquireToFile('test.jpg');">
<object ID=scanner
CLASSID="CLSID:A96AC4E0-6EBF-11D0-AA7C-00608CC9A71F">
</object>
</body>
</html>


this works from commandline (I use the shell("scan.hta") command from runrev). If I would put a Self.Close on the End of the Body onLoad, the scan would not start because the hta is closing before. 

A new problem occured:
The mshta.exe process in any case does not close on the machine I am testing on (xp sp3). => I do need vbs from runrev for that.

In the case the mshta.exe does not close (a problem in ms windows documented in the ms kb) I use the following vbs in field 1 and run it from runrev. This works and closes any process "mshta.exe".

on mouseUp
put field 1 into auftrag; do auftrag as VBScript; put the result 
end mouseUp


set wmi = GetObject("winmgmts:")
wql = "select * from win32_process"
set ergebnis = wmi.ExecQuery(wql)
for each objekt in ergebnis
liste = liste & objekt.name & " Prozess-ID: " & objekt.processID & vbCr
next

wql = "select * from win32_process where name='mshta.exe'"
set ergebnis = wmi.ExecQuery(wql)
for each mshta in ergebnis
mshta.Terminate 0
next



More information about the use-livecode mailing list