I'm writing scriptable plugin for Mozilla browsers. I have no problems 
with using my main class, but I need some other helper classes. I have 
declared my helper class/interface I would like to use in JavaScript:

// Do I need to implement more interfaces here?
class nsMyObject : public nsIMyObject
{
public:
  nsMyObject();
...
}

    This is from IDL, how I use my helper class (nsIMyObject) from my main 
class (nsIMyAppPlugin):

[scriptable, uuid(367e1890- ... -5df0b1fbd5ac)]
interface nsIMyAppPlugin : nsISupports {
  nsIMyObject CreateMyObject();
};

    This is JavaScript example of intended usage:

var mo = embed.CreateMyObject();
mo.someProp = "Something...";
alert(mo.someProp);

    The problem is that I don't know how to create my helper class? :( I 
need it here:

NS_IMETHODIMP nsScriptablePeer::CreateMyObject(nsIMyObject * *_retVal)
{
  *a_retVal = *** create it here... ***
  return NS_OK;
}

Thank you very very much. 


_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to