The problem is in the CreateBrowser function:
http://lxr.mozilla.org/seamonkey/source/embedding/tests/mfcembed/BrowserView.cpp#271
nsCOMPtr<nsIWebBrowserPrint> print(do_GetInterface(mWebBrowser));
if (print) {
print->GetNewPrintSettings(getter_AddRefs(m_PrintSettings));
}
"print" is always null. Perhaps the nsIWebBrowserPrint stuff hasn't been
created/initialized at this point.
One quick hack is to simply add a check for m_PrintSettings in each of the
functions that use it (OnFilePrint, OnFilePrintPreview, and OnFilePrintSetup):
// Get the printer settings
if (!m_PrintSettings)
print->GetNewPrintSettings(getter_AddRefs(m_PrintSettings));
but I think a cleaner solution would be best.
This is also relevant to bug 126976