I am trying to print the current page shown in the ActiveX control from
an MFC app (the demo for the control) using:
void CMozCtlDemoDlg::OnPrint()
{
VARIANT v;
m_Browser.ExecWB (OLECMDID_PRINT, 0, NULL, & v);
}
This prints the page but doesn't return normally. I can print as many
times as I like. The problem is that when I close down the app by
closing the window, the process remains active; when run outside the
debugger it silently leaves a ghost process running.
I looked at the ghost process with spy++. I noticed that it has a
thread separate from the main windowing thread which has a window still
attached: Mozilla:DNSWindow. My guess is that the printing is
implicitly creating a thread with a window and the process will not shut
down until that window/thread exits.
My current efforts are to find some way to locate and shutdown the
thread in question.
If anyone has any suggestions on how to print the page or my approach to
doing it, I would appreciate it.