Click here to Skip to main content
15,912,665 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Changing Picture control size at runtime Pin
Hamid_RT5-Jan-09 2:51
Hamid_RT5-Jan-09 2:51 
QuestionWindows CE remote process viewer Pin
yasir_dm5-Jan-09 2:06
yasir_dm5-Jan-09 2:06 
QuestionAdd custom perfmon counters Pin
runOnce0x5-Jan-09 2:02
runOnce0x5-Jan-09 2:02 
RantRe: Add custom perfmon counters Pin
runOnce0x8-Jan-09 20:50
runOnce0x8-Jan-09 20:50 
QuestionSDI app: Wait for printer Pin
nobaq5-Jan-09 1:56
nobaq5-Jan-09 1:56 
QuestionRe: SDI app: Wait for printer Pin
nobaq5-Jan-09 3:07
nobaq5-Jan-09 3:07 
AnswerRe: SDI app: Wait for printer Pin
Iain Clarke, Warrior Programmer5-Jan-09 3:53
Iain Clarke, Warrior Programmer5-Jan-09 3:53 
QuestionRe: SDI app: Wait for printer Pin
nobaq5-Jan-09 4:41
nobaq5-Jan-09 4:41 
Hello and thank you for your answer!

I do not want to check if the document has printed successfully but it should just be successfully appended to the queue (before the new document is loaded).

I think I managed this (the following code is done in a modal dialog):

// pView is a pointer to my current view (CHtmlView)

// get currently loaded document
CString currentUrl = pView->GetLocationURL();
// load document to be printed
pView->Pall();
// wait until the document has loaded successfully
while(pView->GetReadyState() != READYSTATE_COMPLETE)
{
     ((CMyApp*)AfxGetApp())->Yeild();
}
// FIXXXME: IS THIS OPERATION REALLY BLOCKING?
pView->OnCmdMsg(ID_FILE_PRINT, 0, 0, 0);
// restore old document
pView->Navigate(currentUrl);
// return to my app
EndDialog(FALSE);


The OnCmdMsg(ID_FILE_PRINT) does nothing more than ExecWB(OLECMDID_PRINT,...) in the IWebBrowser2.

And now my "backup question" is.

You said:
"Being slightly serious, the OnCmdMsg (ID_FILE_PRINT, 0, 0, 0) shouldn't return until it's finished its bit of the printing process."

Are you sure that ExecWB(OLECMDID_PRINT,...) will block until the currently loaded document has been printed so that I can issue the next Navigate(...) call just afterwards?

In my tests it works but I am not sure about this.

Regards,
Niki
AnswerRe: SDI app: Wait for printer Pin
Iain Clarke, Warrior Programmer5-Jan-09 5:04
Iain Clarke, Warrior Programmer5-Jan-09 5:04 
AnswerRe: SDI app: Wait for printer Pin
Randor 5-Jan-09 4:52
professional Randor 5-Jan-09 4:52 
QuestionDoubt in using CToolTipCtrl Pin
KASR15-Jan-09 0:56
KASR15-Jan-09 0:56 
AnswerRe: Doubt in using CToolTipCtrl Pin
Iain Clarke, Warrior Programmer5-Jan-09 0:59
Iain Clarke, Warrior Programmer5-Jan-09 0:59 
GeneralRe: Doubt in using CToolTipCtrl Pin
KASR15-Jan-09 1:07
KASR15-Jan-09 1:07 
QuestionHardware info about the network controllers Pin
Pasy_m4-Jan-09 23:29
Pasy_m4-Jan-09 23:29 
AnswerRe: Hardware info about the network controllers Pin
Hamid_RT5-Jan-09 0:37
Hamid_RT5-Jan-09 0:37 
AnswerRe: Hardware info about the network controllers Pin
Randor 5-Jan-09 5:14
professional Randor 5-Jan-09 5:14 
AnswerRe: Hardware info about the network controllers Pin
David Crow5-Jan-09 8:03
David Crow5-Jan-09 8:03 
QuestionAccess Violation ....Very Interesting Pin
Aabid4-Jan-09 23:11
Aabid4-Jan-09 23:11 
GeneralRe: Access Violation ....Very Interesting Pin
CPallini4-Jan-09 23:16
mveCPallini4-Jan-09 23:16 
AnswerRe: Access Violation ....Very Interesting Pin
ThatsAlok4-Jan-09 23:26
ThatsAlok4-Jan-09 23:26 
GeneralRe: Access Violation ....Very Interesting Pin
CPallini4-Jan-09 23:42
mveCPallini4-Jan-09 23:42 
GeneralRe: Access Violation ....Very Interesting Pin
ThatsAlok4-Jan-09 23:48
ThatsAlok4-Jan-09 23:48 
GeneralRe: Access Violation ....Very Interesting Pin
CPallini5-Jan-09 1:16
mveCPallini5-Jan-09 1:16 
AnswerRe: Access Violation ....Very Interesting Pin
Radhakrishnan G.4-Jan-09 23:39
Radhakrishnan G.4-Jan-09 23:39 
GeneralRe: Access Violation ....Very Interesting Pin
Radhakrishnan G.4-Jan-09 23:40
Radhakrishnan G.4-Jan-09 23:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.