|
Prev: Working with DOM in VC++
Next: building DLL
From: Mystique on 7 Sep 2005 06:55 Hi I have an AxWebControl in my application. I want to print the page when it is done loading, how can i do this? In C# i use a function Application.DoEvents() after I tell it to display and before I tell it to print.I need something like this in MFC (C++). Regards, Mystique
From: Rodrigo Corral [MVP] on 7 Sep 2005 10:37 I have this function that I collected from somewhere... maybe could be usefull for you... void CApplication::DoEvents() { MSG msg; while ( ::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) ) { if ( !PumpMessage( ) ) { ::PostQuitMessage(0); break; } } // let MFC do its idle processing for (long lIdle = 0; OnIdle(lIdle); lIdle++ ){;} } -- Un saludo Rodrigo Corral Gonzýlez [MVP] FAQ de microsoft.public.es.vc++ http://rcorral.mvps.org
From: Joseph M. Newcomer on 9 Sep 2005 12:23 Generally, the use of DoEvents is an admission of a design error. You should never need to call a function like this. Using PeekMessage (the answer just given) is something that should be avoided whenever possible (I just got a project that uses this everywhere; it is amazing how convoluted the code has become attempting to emulate multithreading, unsuccessfully) joe On Wed, 7 Sep 2005 12:55:19 +0200, "Mystique" <misic(a)softhome.net> wrote: >Hi >I have an AxWebControl in my application. I want to print the page when it >is done loading, how can i do this? >In C# i use a function Application.DoEvents() after I tell it to display and >before I tell it to print.I need something like this in MFC (C++). > >Regards, >Mystique > Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Rodrigo Corral [MVP] on 14 Sep 2005 09:18 I agree with Joshep that multithreading is near always the best solution for this sort of problems. -- Un saludo Rodrigo Corral Gonzýlez [MVP] FAQ de microsoft.public.es.vc++ http://rcorral.mvps.org
|
Pages: 1 Prev: Working with DOM in VC++ Next: building DLL |