TaiEngWee
November 14th, 2002, 06:12 AM
Hi,
I'm intend to use Microsoft Script control version 1 (msscript.ocx)
in my vb.net application.
In my application, there are multiple thread to handle multiple
script via script control. My thread function is discriped below
Sub ThreadFunction()
Dim code As String
scriptObj = New MSScriptControl.ScriptControl()
voiceChn = New VOICEDEVICESLib.VoiceDevice()
scriptObj.Language = "VBScript"
' scriptObj.Timeout = MSScriptControl.ScriptControlConstants.NoTimeout
scriptObj.AddObject("objVoice", voiceChn, True)
code = ScriptText()
scriptObj.AddCode(code)
scriptObj.Run("Main")
End Sub
voiceChn is my com object.
My problem are:
1. I'm getting error on scriptObj.Timeout statement-- 'Timeout' is ambiguous across the inherited
interfaces "MSScriptControl.IScriptControl' and 'MSScriptControl.DScriptControlSource_Event'
How to set the script control timeout property to NoTimeOUT?
2. My application need to run 2 script object simultaneously. However, if script obj 1 is running
a lengthy while loop, script obj2 will stop its process until obj 1 is finish that loop. Eventhough
I had spawned thread for each script obj...It is because of the msscript having apartment thread modelling.
How am i going to handle this?
Your help is much appreciated...
thanks!
:(
I'm intend to use Microsoft Script control version 1 (msscript.ocx)
in my vb.net application.
In my application, there are multiple thread to handle multiple
script via script control. My thread function is discriped below
Sub ThreadFunction()
Dim code As String
scriptObj = New MSScriptControl.ScriptControl()
voiceChn = New VOICEDEVICESLib.VoiceDevice()
scriptObj.Language = "VBScript"
' scriptObj.Timeout = MSScriptControl.ScriptControlConstants.NoTimeout
scriptObj.AddObject("objVoice", voiceChn, True)
code = ScriptText()
scriptObj.AddCode(code)
scriptObj.Run("Main")
End Sub
voiceChn is my com object.
My problem are:
1. I'm getting error on scriptObj.Timeout statement-- 'Timeout' is ambiguous across the inherited
interfaces "MSScriptControl.IScriptControl' and 'MSScriptControl.DScriptControlSource_Event'
How to set the script control timeout property to NoTimeOUT?
2. My application need to run 2 script object simultaneously. However, if script obj 1 is running
a lengthy while loop, script obj2 will stop its process until obj 1 is finish that loop. Eventhough
I had spawned thread for each script obj...It is because of the msscript having apartment thread modelling.
How am i going to handle this?
Your help is much appreciated...
thanks!
:(