Problem with Windows Script Control and Timeout in an ActiveX Dll 
Author Message
 Problem with Windows Script Control and Timeout in an ActiveX Dll

I'm using the Windows Script Contol to implement basic scripting ability in
an app.

I have referenced the control and am instantiating the control as follows:

    Private WithEvents oScr as ScriptControl
    Set oScr = New ScriptControl

So far, all is well and good.

Next I set a few properties:

    oScr.AllowUI = False
    oScr.Timeout = lTimeout        ' lTimeout is a long containg the number
of milliseconds (by default 60000)

Next I load in script which is contained in a text file into a string.  It
is very short, typically no more than 20 lines.
Then I add that code to the script control

    oScr.AddCode sCode

Finally, I run the script by calling the "Main" sub (which is in the script

    oScr.Run "Main"

This works well the script runs just fine and everything is good.

According to the docs, if the script takes more time to run than the
timeout, it will be terminated.  This is the problem I am having.  The
script will not get terminated if it times out and I can think of no way to
force it to terminate.  One odd thing about this, is if I repeat the steps
above with a standard VB Windows project, it works fine and the timeout
occurs.  If I do this in an ActiveX Dll, I don't get the timeout.

Can anyone shed any light on this problem?


Chris Dunaway

Wed, 05 May 2004 03:29:57 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Problem with scripting ATL 7.0 ActiveX Control under Windows 98

2. Building ActiveX controls that will access activex.dll running on PWS

3. Using Script from within ActiveX Control (scripting control???)

4. ActiveX Dll - How to Timeout?

5. ADO timeout not working in ActiveX DLL

6. Problem running ActiveX control from script

7. ActiveX control and Client script interaction problem

8. Problem running ActiveX control from script

9. Problems Installing Windows Script 5.0 and Windows Script Host 2.0 Beta on Windows NT 4.0

10. Wrapping vb.NET Windows contol library dll as COM ActiveX control for use in VB6

11. Problem in executing script to validate events of ActiveX controls in IE5.0

12. VB script calling activeX control problem


Powered by phpBB® Forum Software