[EMAIL PROTECTED] wrote:
> Hi
>
> Im porting an activex component written for internet expolrer to xpcom. My
> problem is that evenything works fine except i donot know how can i fire
> events from my xpcom component.
>
> My activex intracts with a usb device, which has many embeded applications
> in it. when user choose any application from device, control should fire an
> event(which my current activex doing perfactely) and I should be able to
> handle that event from client side javascript(activex is doing it). Can
> anyone helps me in this regards. If anybody has an idea plz explain with
> some small sample code.
>
> Thanks in advance
>
> Amandeep.
The easiest way to make simple calls back to your javascript from your
plugin is to use the NPN_GetURL function and make
"javascript:function_name(params)" to "_self" as in:
const char *szJS = "javascript:test_func('data here', 'you could use
sprintf to build this string')";
NPN_GetURL(m_Instance, szJS, "_self");
since URLs that start with 'javascript:function_name()' call code and
not load a new page. That was a big slap in the forehead moment for me
once I realized that. That should get you by unless you want to send
back more complex data.
-DrCaptcha
-----
Disgrutled grad. student in image processing who solves difficult
Captchas (http://en.wikipedia.org/wiki/Captcha) for tuition money. Will
program for food.
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom