Patrick McHale wrote:

> What is a
> notifier?. 


The notifier John was talking about is your function that does the 
actual work, and wants to call the callback.

> What do you mean by registering it with the notifier.


As per the example - you pass an extra COM object to the function.  The 
function then remembers this COM interface (using an nsCOMPtr) and when 
ready, calls a method on this object.

> How do you call it like any other method when
> you want to do the notification. 


Your function has a pointer to a different COM interface.  Your function 
calls this COM interface like any other COM interface.  It just so 
happens that this COM interface was designed by you, and has the 
callback method defined.

> It is going to be dificult trying to figure
> all this out without an actual example of code to follow and understand.


I don't know of any "simple" examples.  All such examples are buried 
within Mozilla itself and may just confuse the issue even more.


> We
> have some very experienced software engineers here who but we are still not
> able to follow this process you mentioned. 


It would seem they just need some more xpcom experience - or even ms-com 
experience.  John gave you very detailed and clear instructions - 
although I can say that with the benefit of experience.

> Attached is a sample HTML file
> zipped. Our latest attempt ended up with a NULL listener being passed from
> the javascript into the C++ code.  We do not understand why.


That is too big for me to spend the time digging through.  It certainly 
seems you missed the key point that the listener function is to be a 
method on a class.  This class with your method is _itself_ an xpcom 
object - but one implemented in JavaScript.  ie, you have 2 xpcom 
interfaces - your C++ one that does the work, and another implemented in 
JavaScript with the notify function.

John was very explicit about this:

 >>var listener = {
 >> connectionOpened : function(success) {
 >> if (success)
 >> alert("The Connection was made!")

I hope this helps.

Mark.


Reply via email to