直接用microsoft script control 1.0就行了,为什么还要再写一个Msscript.ocx?
You might have to compile a TypeLib to define the interface for you. If so, you'll need VS for the ActiveScript IDL and MIDL to compile it. If you don't have it, here's a quick search: "VB IActiveScript" http://www.planet-source-code.com/URLSEO/vb/scripts/ShowCode!asp/txtCodeId!50302/lngWid!1/anyname.htmOtherwise: http://doc.ddart.net/msdn/header/include/activscp.idl.htmlhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/IActiveScript_GetScriptThreadID.aspThis method of the interface returns (ByRef) the ThreadID that the script (of your choice) is executing within. The link also mentions the method InterruptScriptThread() which should cancel it's execution. If you want pause/resume functionality, you could possibly use the API functions SuspendThread() and ResumeThread() with the returned ThreadID for the script.Private Declare Function SuspendThread Lib "kernel32" Alias "SuspendThread" (ByVal hThread As Long) As Long Private Declare Function ResumeThread Lib "kernel32" Alias "ResumeThread" (ByVal hThread As Long) As Long
"VB IActiveScript"
http://www.planet-source-code.com/URLSEO/vb/scripts/ShowCode!asp/txtCodeId!50302/lngWid!1/anyname.htmOtherwise:
http://doc.ddart.net/msdn/header/include/activscp.idl.htmlhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/IActiveScript_GetScriptThreadID.aspThis method of the interface returns (ByRef) the ThreadID that the script (of your choice) is executing within. The link also mentions the method InterruptScriptThread() which should cancel it's execution. If you want pause/resume functionality, you could possibly use the API functions SuspendThread() and ResumeThread() with the returned ThreadID for the script.Private Declare Function SuspendThread Lib "kernel32" Alias "SuspendThread" (ByVal hThread As Long) As Long
Private Declare Function ResumeThread Lib "kernel32" Alias "ResumeThread" (ByVal hThread As Long) As Long