Thank you for your kindness.But your advice can't help ,May be I can't
understand what you say.
I have write a xpcom,but the xpcom is based on the win32 api and C++.
All the thing havn't been down in the bottom model.Now I want to use
the xpcom in the firefox.Now the xpcom can work,but I can't let my
xpcom fire the event.That means I don't have event mechanism.
The test code is following:(js)
var cookie_value=0;
var statuschanged=false;
function change()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
statuschanged=SipWebCall.IsChanged();
if(statuschanged)
{
cookie_value=SipWebCall.GetP2TStatus();
alert(cookie_value);
}
}
function DoInit() {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
const cid = "@contactID;1";
SipWebCall = Components.classes[cid].createInstance();
SipWebCall =
SipWebCall.QueryInterface(Components.interfaces.nsIMyP2TCom);
} catch (err) {
alert(err);
return;
}
SipWebCall.SetProxyServer('admin.com');
SipWebCall.SetUserId('num','password');
window.setInterval(change,1000);
}
function MyComponentTestGo()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
SipWebCall.MakeCallTo('num','licence');
}
function HandUp()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
SipWebCall.DropCall();
}
//Note: When my xpcom register , makecallto or dropcall,all the actions
with return some status.
//That means the "cookie_value" is changed when something has happened.
//Now I check the status one time per 1s,What I want to do is when the
status is changed .It can notify me but not let me to check it.
_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom