Re-4: using an ActiveX (twiz32.ocx) from runrev by vbs
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 titleScannen/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 ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Re-4: using an ActiveX (twiz32.ocx) from runrev by vbs
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 Yes, I do something similar in a more generic kill process handler of mine (watch word wraps): on stsKillProcess pProcNameOrID put the VBS_KillProcess of this stack into tScript if isNumber(pProcNameOrID) then replace PROCATTRIB with Process.ProcessID in tScript replace PROCVALUE with pProcNameOrID in tScript else replace PROCATTRIB with Process.Caption in tScript replace PROCVALUE with (quote toLower(pProcNameOrID) quote) in tScript end if put stsDoScript(tScript,VBS) into tResult -- I have a wrapper around do script that does -- some add'l error checking, etc.) if tResult is not empty then answer tResult end stsKillProcess --- This is the VBS_KillProcess custom property contents: Set ProcessSet = GetObject(winmgmts:{impersonationLevel=impersonate}).ExecQuery(select * from Win32_Process) tResult = For each Process in ProcessSet If Process.ExecutablePath Then If LCase(PROCATTRIB)=PROCVALUE Then Process.Terminate (Process.ProcessID) Else tResult=STSError: Process not found. End If End If Next WScript.Echo tResult -- Never thought of using HTAs though... :-) Ken Ray Sons of Thunder Software, Inc. Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
using an ActiveX (twiz32.ocx) from runrev by vbs
Hello, Is it possible and how can we use activeX with the alternateLanguage Function of runrev by the way of visual basic script vbs? I do know how to run Excel or Word from runrev in this way (using COM and createObject), but not how to use an ocx. Any idea or suggestions? I use an ocx (Olympus Twain Wizard) for administration of a scanner on windows (TWAIN). This works in Visual Basic 6.0 without any user interaction (in this case Scan if the Form opens:) Private Sub Form_Load() Form1.Twiz1.AutoFeeder = True Form1.Twiz1.ShowUI = False Form1.Twiz1.Resolution = 300 Form1.Twiz1.AcquireToFile (c:\test.jpg) End Sub Now I try to do this with vbs in runrev (but I do not know whether this is possible). I tried scanner = CreateObject(Twizlib.Twiz) scanner.AutoFeeder = True scanner.MaxImages = 3 scanner.ShowUI = False scanner.Resolution = 300 scanner.AcquireToFile(c:\test.jpg) But the ocx seems not to be accessible by createObject (The ActiveX object can not produce a new object). To be shure: But this error even occurs when the name of the class is wrong. The Typelib ID of this ocx is {A96AC4E1-6EBF-11D0-AA7C-00608CC9A71F} the most importent methods and settings are ShowUI = False AcquireToFile(c:\test.jpg) Regards Mit freundlichen Grüßen Franz Böhmisch [EMAIL PROTECTED] http://www.animabit.de GF Animabit Multimedia Software GmbH Am Sonnenhang 22 D-94136 Thyrnau Tel +49 (0)8501-8538 Fax +49 (0)8501-8537 ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: using an ActiveX (twiz32.ocx) from runrev by vbs
Hi Franz, I don't think you can use sub routines in the do command. Each time when you call form_load, you'll probably have to rewrite the entire function verbose. Sometimes, I have to experiment a bit with the createObject function to make it work. For example, adding set' in front of the scanner variable might work: set scanner = createObject(TwizLib.Twiz) -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering http://economy-x-talk.com http://www.salery.biz Dutch forum: http://runrev.info/rrforum/ Benefit from our inexpensive hosting services. See http://economy-x-talk.com/server.html for more info. On 25 sep 2008, at 10:47, [EMAIL PROTECTED] wrote: Hello, Is it possible and how can we use activeX with the alternateLanguage Function of runrev by the way of visual basic script vbs? I do know how to run Excel or Word from runrev in this way (using COM and createObject), but not how to use an ocx. Any idea or suggestions? I use an ocx (Olympus Twain Wizard) for administration of a scanner on windows (TWAIN). This works in Visual Basic 6.0 without any user interaction (in this case Scan if the Form opens:) Private Sub Form_Load() Form1.Twiz1.AutoFeeder = True Form1.Twiz1.ShowUI = False Form1.Twiz1.Resolution = 300 Form1.Twiz1.AcquireToFile (c:\test.jpg) End Sub Now I try to do this with vbs in runrev (but I do not know whether this is possible). I tried scanner = CreateObject(Twizlib.Twiz) scanner.AutoFeeder = True scanner.MaxImages = 3 scanner.ShowUI = False scanner.Resolution = 300 scanner.AcquireToFile(c:\test.jpg) But the ocx seems not to be accessible by createObject (The ActiveX object can not produce a new object). To be shure: But this error even occurs when the name of the class is wrong. The Typelib ID of this ocx is {A96AC4E1-6EBF-11D0-AA7C-00608CC9A71F} the most importent methods and settings are ShowUI = False AcquireToFile(c:\test.jpg) Regards Mit freundlichen Grüßen Franz Böhmisch ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re-2: using an ActiveX (twiz32.ocx) from runrev by vbs
Hi Mark, of course you are right - I cannot Form like in vb6 and dont try this. I just tried scanner = CreateObject(Twizlib.Twiz) scanner.AutoFeeder = True scanner.MaxImages = 3 scanner.ShowUI = False scanner.Resolution = 300 scanner.AcquireToFile(c:\test.jpg) I will test your suggestion: SET scanner = createObject(TwizLib.Twiz) this might be a starting point. Thanks! Franz Original Message Subject: Re: using an ActiveX (twiz32.ocx) from runrev by vbs (25-Sep-2008 11:05) From:Mark Schonewille [EMAIL PROTECTED] To: [EMAIL PROTECTED] Hi Franz, I don't think you can use sub routines in the do command. Each time when you call form_load, you'll probably have to rewrite the entire function verbose. Sometimes, I have to experiment a bit with the createObject function to make it work. For example, adding set' in front of the scanner variable might work: set scanner = createObject(TwizLib.Twiz) -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering http://economy-x-talk.com http://www.salery.biz Dutch forum: http://runrev.info/rrforum/ Benefit from our inexpensive hosting services. See http://economy-x-talk. com/server.html for more info. On 25 sep 2008, at 10:47, [EMAIL PROTECTED] wrote: Hello, Is it possible and how can we use activeX with the alternateLanguage Function of runrev by the way of visual basic script vbs? I do know how to run Excel or Word from runrev in this way (using COM and createObject), but not how to use an ocx. Any idea or suggestions? I use an ocx (Olympus Twain Wizard) for administration of a scanner on windows (TWAIN). This works in Visual Basic 6.0 without any user interaction (in this case Scan if the Form opens:) Private Sub Form_Load() Form1.Twiz1.AutoFeeder = True Form1.Twiz1.ShowUI = False Form1.Twiz1.Resolution = 300 Form1.Twiz1.AcquireToFile (c:\test.jpg) End Sub Now I try to do this with vbs in runrev (but I do not know whether this is possible). I tried scanner = CreateObject(Twizlib.Twiz) scanner.AutoFeeder = True scanner.MaxImages = 3 scanner.ShowUI = False scanner.Resolution = 300 scanner.AcquireToFile(c:\test.jpg) But the ocx seems not to be accessible by createObject (The ActiveX object can not produce a new object). To be shure: But this error even occurs when the name of the class is wrong. The Typelib ID of this ocx is {A96AC4E1-6EBF-11D0-AA7C-00608CC9A71F} the most importent methods and settings are ShowUI = False AcquireToFile(c:\test.jpg) Regards Mit freundlichen Grüßen Franz Böhmisch ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution To: use-revolution@lists.runrev.com ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re-3: using an ActiveX (twiz32.ocx) from runrev by vbs
Hello This HTML-Page starts immediately (after a security warning on xp sp3 but this I think can be avoided) !DOCTYPE HTML PUBLIC -//IETF//DTD HTML//EN html head BODY onLoad=scanner.CurrentSource=2;scanner.ShowUI = 'False';scanner.AcquireToFile('c:\test.jpg') object ID=scanner CLASSID=CLSID:A96AC4E0-6EBF-11D0-AA7C-00608CC9A71F /object /body /html Question: How to translate this in vbs code which I can send to the wsh using do in runrev? Regards Franz ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Re-2: using an ActiveX (twiz32.ocx) from runrev by vbs
I will test your suggestion: SET scanner = createObject(TwizLib.Twiz) this might be a starting point. Thanks! BTW, as someone who's done a lot of VBScripting with Rev, I would strongly recommend that you write up the VBScript in a text file (Notepad works, or TextPad, etc.), and save it as a .vbs file. Then try to double-click the .vbs file and see if it does what you want. If it does, then you only need to utilize that VBScript from Rev (with minor exceptions about returning values to Rev from VBS) in order to get your app to work. 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. Ken Ray Sons of Thunder Software, Inc. Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Re-3: using an ActiveX (twiz32.ocx) from runrev by vbs
Question: How to translate this in vbs code which I can send to the wsh using do in runrev? Sounds like you're trying to implement an OCX, which when I looked it up on the web was from back in 1999 when VB4 was around. OCXes are controls that are placed on a form in VB (like the 3-D buttons, grid controls, etc.). I don't know if you can use those from just plain VBScript files. One thing you *can* do, is to use VB6 to create a DLL that has the Twain Wizard OCX attached, and then call it from a VBScript file (which would mean that it could also be called from Rev's do script... command). Check out this page on how to use non-Rev DLLs with Rev: http://www.sonsothunder.com/devres/revolution/tips/ext002.htm Ken Ray Sons of Thunder Software, Inc. Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ ___ use-revolution mailing list use-revolution@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-revolution