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

Your name:

Reply:


Posted by mrrrhanson on 12/19/07 06:16

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..

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация