Re: 0x8000FFFF error when calling a Javascript function from C++.



Igor Tandetnik wrote:
"Andrew Yao" <andrewyao@xxxxxxxxx> wrote in message news:n3I5f.2$RC4.38@xxxxxxxxxxxxxxxxxx

Does anyone know what could cause this? This ActiveX uses the
Asynchronous Pluggable Protocol from Igor Tandetnik, so this particular
call could be executing from a different thread to the main IE browser
thread.


Can't do that. Once initialized on a particular apartment, a script engine must be called on the same apartment. In your case it means you can only call the script on the main UI thread. Use Switch / Continue to switch to the main thread if you have to.

Thanks so much Igor.

Your comments are always dead-on. I called the script by sending a message to the main UI thread and it works.

I am not quite sure how to use Switch/Continue however. Is there an example that I could take a look at?

In my case, The Controller App, the WebBrowser control and where APP generates Request/Response are all in separate threads.

thanks again... You are super..

Andrew


.



Relevant Pages

  • Re: 0x8000FFFF error when calling a Javascript function from C++.
    ... > Asynchronous Pluggable Protocol from Igor Tandetnik, ... Once initialized on a particular apartment, a script ... switch to the main thread if you have to. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Webster van Robot help
    ... Install Microsoft Script Debugger or Visual studio. ... Use a switch statement. ... the robot does in fact move. ...
    (comp.lang.javascript)
  • Re: Reminder for sent messages
    ... There's no switch on a message for this - you could ask Microsoft for this ... It's a script or nothing. ... > don't get a reminder to ALL of the messages you send. ...
    (microsoft.public.mac.office.entourage)
  • Virtual Consoles disabled REVISITED
    ... the lower Virtual Consoles. ... If I switch out, all I have is a blank ... And that did it.  There should probably be some way to ensure that the rc scripts complete normally even if some component cannot complete without error.  Also, I obviously need to look at the P3SCAN init script to see why it doesn't just start a daemon and exit. ... Life is too short to tolerate crappy software! ...
    (Ubuntu)
  • Re: Is this script safe?
    ... On 28 Oct 2005 at 10:05, Jay Savage wrote: ... >>> I wanted a script that would rename files from lower to upper case. ... Found 39 lowercase files ... Yes the T switch was giving me errors it the scripts former state. ...
    (perl.beginners)