Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Problems Capturing activex events in HTAfiles using VBS ,,JS works

Reply
Thread Tools

Problems Capturing activex events in HTAfiles using VBS ,,JS works

 
 
mrrrhanson
Guest
Posts: n/a
 
      12-19-2007
Hi.
I was converting a file from JS to VBS and ran upon the problem of
captureing events.

The quik questions ..

Can i capture activex events in an .hta file useing vbscript ...??
Is JScript the only way to do this inside an .htm file?

//////////////////////////////////
<SCRIPT LANGUAGE="JavaScript">

// Create the Sapi SpVoice object
var VoiceObj = new ActiveXObject("Sapi.SpVoice");

// lots of fun code

// Handle EndStream Event
function VoiceObj::EndStream() {
idbSpeakText.value = "SpeakText";
idImage.src = "mouthclo.bmp";
}

//// Events are captured and useable useing JScript.. but, i want to be able
to use all VBscript
//////////////////////////////////////////////

'----
My conversion of the 'fun code' to vbs is fine, but the events dont work
'----
<SCRIPT LANGUAGE="VBScript">

Dim VoiceObj : Set VoiceObj = Createobject("Sapi.SpVoice") ' this cannot
find server.. thus no events

'// Handle EndStream Event
Sub VoiceObj_EndStream()
idbSpeakText.value = "SpeakText"
idImage.src = "mouthclo.bmp"
End Sub

'-- then i tried

Dim WithEvents
Set VoiceObj = CreateObject("Sapi.SpVoice")
' this dont do it.. no events

'--
i cannt use this one cuz it needs WScript object (but it works fine in a
xxxx.vbs file
Set VoiceObj = WScript.CreateObject("VoiceObj","VoiceObj_")

i have adjusted and tinkered all the code .... and must be missing
something.
is a Type library the answer..? i have'nt checked on these yet..


 
Reply With Quote
 
 
 
 
Bergamot
Guest
Posts: n/a
 
      12-20-2007
mrrrhanson wrote:
>
> I was converting a file from JS to VBS and ran upon the problem of
> captureing events.


If you choose to use VBScript, you obviously aren't doing anything for a
publicly accessible web site since VBS is a Windows IE only thing. I
suggest you ask Microsoft what's wrong with, or how to use/program,
their stuff.
microsoft.public.pick-a-better-newsgroup-than-alt-html

In the event you are supposed to be doing something for a publicly
accessible web site, stick with JS.
comp.lang.javascript is over there ->

--
Berg
 
Reply With Quote
 
 
 
 
mrrrhanson
Guest
Posts: n/a
 
      12-21-2007

"Bergamot" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> mrrrhanson wrote:
>>
>> I was converting a file from JS to VBS and ran upon the problem of
>> captureing events.

>
> If you choose to use VBScript, you obviously aren't doing anything for a
> publicly accessible web site since VBS is a Windows IE only thing. I
> suggest you ask Microsoft what's wrong with, or how to use/program,
> their stuff.
> microsoft.public.pick-a-better-newsgroup-than-alt-html
>
> In the event you are supposed to be doing something for a publicly
> accessible web site, stick with JS.
> comp.lang.javascript is over there ->
>
> --
> Berg

Thanks for the info ,,
This is for my own learning experiance.
i did figure that js is more common cuz that seems the common language in
pages,
and dont seem to popup the active X warnings.
I asked here cuz i thought maybe someone may have experianced the the
problem..
and will probly use/learn more JS.
-- Morris


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP not working, but same code in VBS works San Diego Guy ASP General 0 01-22-2006 12:18 AM
When I turn on my PC, it works, works, works. Problem! Fogar Computer Information 1 01-17-2006 12:57 AM
Events Events Events Please Help Chris ASP .Net Web Controls 0 08-30-2005 08:21 PM
ActiveX apologetic Larry Seltzer... "Sun paid for malicious ActiveX code, and Firefox is bad, bad bad baad. please use ActiveX, it's secure and nice!" (ok, the last part is irony on my part) fernando.cassia@gmail.com Java 0 04-16-2005 10:05 PM
After rebooting my PC works, works, works! Antivirus problem? Adriano Computer Information 1 12-15-2003 05:30 AM



Advertisments