You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
Thanks for the info, I found the IDL and modified it and generated a typelib from it. Once that was done it was some simple mods to get the code to work. One last question though, I need to signal the end of the script by creating a method called End on the myObject class. How do I signal the current ActiveScript that I am done and that it should exit?
Thanks
Sr. Software Development Engineer and Sr. Information Security Analyst,
CEH, Digital Forensic Examiner
Sorry, but I don't understand what you mean. When you call hr = pIActiveScript.SetScriptState(%SCRIPTSTATE_CONNECTED), the script will execute synchroniously. The next instruction in your program will be executed when the script will end.
Okay.. I have an object myScript, on that object is a method called End.. in the script I will have the line myScript.End at which point I need the script to end. I assume that in the method End I set some sort of signal or state to the IACTIVESCRIPT object that says.. "the script has ended" but not sure how to do it..
Sr. Software Development Engineer and Sr. Information Security Analyst,
CEH, Digital Forensic Examiner
You can add a method to set a flag and call it from the script code, although I don't see the purpose, because the script will end when it ends, not when you say that has ended.
CLASS CMyObject $IID_CMyObject
INTERFACE IMyObject $IID_IMyObject
INHERIT IDispatch
METHOD SayHi (BYVAL bstrTo AS STRING)
PRINT "Say Hi to " & ACODE$(bstrTo)
END METHOD
METHOD Sum (BYVAL a AS LONG, BYVAL b AS LONG)
PRINT STR$(a) & " +" STR$(b) & " =" & STR$(a + b) & ", isn't it?"
END METHOD
METHOD Finished
PRINT "Finished"
END METHOD
END INTERFACE
END CLASS
I found it.. I need to call the method InterruptScriptThread in my object
Method Finished()
myActivSco.InterruptScriptThread(threadId, ei, 0)
End method
This will interrupt the thread and signal an error and a state change. Now the problem I have is the Exception Info.
Local ei As EXCEPINFO
ei.wCode = 0
ei.sCode = 0
ei.dwHelpContext = 210
When I pass this to the InterrupScriptThread method, IActiveScript is supposed to pass this directly to the OnScriptError event. No matter what I
do it returns 80004005, this means that it does not understand the EXCPEINFO that I am passing in
am I passing this in properly?
Definition of InterrupScriptThread
Method InterruptScriptThread(ByVal stidThread As Dword, ByRef In pexcepinfo As EXCEPINFO, ByVal dwFlags As Dword) As _
Long
Code:
Method End()
Local scrThreadId As Long
Local ei As EXCEPINFO
ei.wCode = 0
ei.sCode = 0
ei.dwHelpContext = 210
pIActiveScript.GetCurrentScriptThreadID(scrThreadId)
pIActiveScript.InterruptScriptThread(scrThreadId, ei, 0)
End Method
Sr. Software Development Engineer and Sr. Information Security Analyst,
CEH, Digital Forensic Examiner
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment