How to call correctly SerializeToString (from nsIDOMSerializer object) in a XPCOM component? It is very easy to do it in JavaScript (new XMLSerializer().SerializeToString(doc)), but I need to call it in C++.
I have created successfully a IDOMDocument (using ParseElement() from the nsIDOMParser object) and populated it with nodes. (well, I think so) I have included the nsIDOMSerializer.h (created from nsIDOMSerializer.idl) I have to pass a PRUnichar** as the return parameter to SerializeToString. I tried to pass an address of a variable pointing to an uninitialized buffer, and a pointer to a NULL pointer (because it seems to allocate the string and return its address). Both tries didn't worked, and all returned me the error 0x805303F4 (I searched the source code and didn't find that code literally) Environment: Netscape 7.1; source code: Mozilla 1.4 I have seen examples of use of SerializeToString in the source code, but all them require the nsXPIDLCString that is not available in XPCOM Glue. What is wrong here? EEW.
