Monthly Archives: September 2006

Handle ActiveX event in VBScript

The shell VBScript can handle ActiveX event as well. The following is an example on how to handle the events from our Active TTS  component.

 Save it and click to run on your desktop after installing our component.

 

Dim tts
Set tts = WScript.CreateObject(“TTSObj.TextToSpeech.1″, “tts_”)
tts.Speak “Hello world”, 0
sub tts_OnTTSStart
msgBox “start”
end sub

sub tts_OnTTSEnd
msgBox “end”
end sub

Check snap errors with htmlsnapshot

htmlsnapshot supports reporting error code for SnapUrl function. This can help you decide the problem of failing to snap certain pages.

 It works like this:

snap.SnapUrl(…..) 

 iErrorCode=snap.GetErrorCode()

The error code is an interger value which has following values:

0: The normal state.

1: The snapshot is successfully taken.

-1: Fail to take the snapshot of the page, check if your html image is too big to be fit into memory,

-2: Fail to save to file, check if you can write to the output image path

-3: Fail to open the URL. check network please

-4: Time is out before taking a snapshot, use a larger time out value or call SetForceSnap before snapping.