Re: VBControlExtender und Windows Scripting (wshom.ocx)



Michael Biermann schrieb:
> ich würde gerne mein VB-Projekt für die Anwender um Windows Scripting
> erweitern, damit diese externe VBS-Dateien starten können. Dazu wollte ich
> das Windows Scripting Control "wshom.ocx" per "late binding" über den
> VBControlExtender während der Laufzeit hinzufügen, damit keine Probleme
> auftreten, falls jemand den Windows Scripting Host nicht installiert hat.
>
> Folgenden Code verwende ich:
>
> ------------------------------------------------------------
> Private WithEvents WScript As VBControlExtender
>
> Private Sub Form_Load()
>
> Set WScript = Controls.Add("WScript.Shell.1", "WScript1")
>
> End Sub
> ------------------------------------------------------------
>
> Laut Registry ist die ProgID vom Windows Scripting Control =
> "WScript.Shell.1" oder "WScript.Network.1".
>
> Allerdings meckert VB immer bei der Zeile "Set WScript =....":
>
> Error: 720 - 'WScript.Shell' ist kein gültiger Steuerelementtyp

Der Windows-Scripting Host bzw. sein Objekte, sind keine
Steuerelemente. Daher ist Controls.Add hier sinnfrei, statt dessen
reicht die Erstellung per CreateObject. Ereignisse werden ebenfalls
keine ausgelöst.

Thorsten Dörfler
--
vb-hellfire - einfach anders
http://www.vb-hellfire.de/
.



Relevant Pages

  • Re: SEEK: utility to add file date to name
    ... 2K and later have Windows Scripting Host that runs vbscript and jscript code from the command line--with older versions of windows you have to invoke it with cscript but in Vista you can just type "helloworld" on the command line and if helloworld.vbs is anywhere in your search path it will run. ...
    (rec.photo.digital)
  • Re: Running a job on a remote machine (and continues "here" after its done)
    ... My software uses Tcl/Tk as the scripting language, ... The Tcl/Tk shell (let's call it Host) sit on a Windows machine ... this is possible and easy to do in Tcl. ...
    (comp.lang.tcl)
  • Re: Are you protected by NAT?
    ... Im not talking about a private address - im talking about how we see ... *you* from here - ie. we see the public side of the nat, ... Scripting is UNINSTALLED on all systems, ... certainly not a singular fix to security dilemmas. ...
    (comp.security.firewalls)
  • Re: newbie to scripting
    ... VBScript is a scripting language derived from Visual Basic. ... host programs interpret your program (a program with VBScript statements ... I am new to scripting and would like to learn more about WSH. ...
    (microsoft.public.scripting.wsh)
  • Re: Script-Sprache für MFC-Programm
    ... Scripting Host generell abgeschaltet. ... Der Host ist doch nur die Laufzeitumgebung, die VBS und JScript ... pp. wie jedes andere Programm zugreifen kann. ...
    (microsoft.public.de.vc)