How can I access javascript in ATL? 
Author Message
 How can I access javascript in ATL?

I made com with ATL like below..

    // component
    STDMETHODIMP Ckizmo::get(int tcount)
    {
     AFX_MANAGE_STATE(AfxGetStaticModuleState())

    ... do some..

     _beginthread(threadFunc,0, &myParam);

     return S_OK;
    }

And there is javascript function like below..
    <script>
    function callTest(param){
        alert(param);
    }
    function run(){
        CKizmo.get(3);
    }
    </script>
    <object ID="CKizmo" NAME="CKizmo"classid="CLSID:XXX-XXX">

How can I call javascript (callTest) in thread?

If it possible, I think it is possible..^^ , what is needed? (parameter
etc...)



Fri, 13 May 2005 22:42:47 GMT  
 How can I access javascript in ATL?
You should not. WebBrowser is a single-threaded component. Calling it
from the worker thread violates COM rules and can lead to unpredictable
behavior. In the best case, the program will crash immediately. In the
worst, according to the Murphy's law, it will appear to work throughout
your testing, then crash right when you show it to your boss or most
important customer.

You may want to read http://www.mvps.org/vcfaq/com/1.htm , where a
similar issue is discussed.
--
With best wishes,
    Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken


Quote:
> I made com with ATL like below..

>     // component
>     STDMETHODIMP Ckizmo::get(int tcount)
>     {
>      AFX_MANAGE_STATE(AfxGetStaticModuleState())

>     ... do some..

>      _beginthread(threadFunc,0, &myParam);

>      return S_OK;
>     }

> And there is javascript function like below..
>     <script>
>     function callTest(param){
>         alert(param);
>     }
>     function run(){
>         CKizmo.get(3);
>     }
>     </script>
>     <object ID="CKizmo" NAME="CKizmo"classid="CLSID:XXX-XXX">

> How can I call javascript (callTest) in thread?

> If it possible, I think it is possible..^^ , what is needed?
(parameter
> etc...)



Sat, 14 May 2005 01:38:14 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ATL with Javascript : Help Needed

2. ATL ActiveX Worker Thread to JavaScript Event Handler Not Work

3. ATL COM from JAVASCRIPT

4. Problem accessing user control element from javascript

5. Determining what canned preprocessor symbols are available

6. Beginner [Q] Using Canned File Open/Save dialog

7. Help with compiling a "canned" program

8. Canned Dialogs

9. ATL Control with VARIANT in Connection point : Access Violation

10. ATL access COM Port

11. ATL Components for Database Access

12. Open Connection Access Violation for ADO in ATL COM

 

 
Powered by phpBB® Forum Software