Hi,
I have active-x class written in c# which is multi-threaded. I need to call javascript from my activeX. I tried it by Microsoft.mshtml .
/*JS
function do_Print() {
control.setPage(this);
control.scriptPrint();
}
function report_back(report){
alert("Report:"+report);
}
C#
public void setPage(mshtml.HTMLWindow2Class JSFile) {
window = JSFile;
}
public void scriptPrint(){
window.execScript("report_back('Printing complete!')", "JScript");
}
*/
But its throwing exception
"unable to cast COM object of type 'mshtml.HTMLWindow2Class' to interface type 'mshtml.DispHTMLWindow2'"
Is there another way round. I am able to call active-x function from java script but vice versa still got above exception. Any idea for multi-threaded c# active-x calling javascript function ???