return doc->QueryInterface(kIDocumentIID, (void**) aInstancePtrResult);
return doc->QueryInterface(NS_GET_IID(nsIDocument), (void**) aInstancePtrResult);
NS_NewImageDocument(nsIDocument** aInstancePtrResult){  nsImageDocument* doc = new nsImageDocument();  if(doc)    return doc->QueryInterface(kIDocumentIID, (void**) aInstancePtrResult);  return NS_ERROR_OUT_OF_MEMORY;}