Click here to Skip to main content
15,915,336 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Store int values in descending order Pin
CodingLover11-Feb-08 15:39
CodingLover11-Feb-08 15:39 
GeneralError transferring a CString to LPTSTR Pin
Larry Mills Sr10-Feb-08 11:27
Larry Mills Sr10-Feb-08 11:27 
GeneralRe: Error transferring a CString to LPTSTR Pin
Mark Salsbery10-Feb-08 12:01
Mark Salsbery10-Feb-08 12:01 
GeneralRe: Error transferring a CString to LPTSTR Pin
Larry Mills Sr11-Feb-08 3:18
Larry Mills Sr11-Feb-08 3:18 
QuestionRe: Error transferring a CString to LPTSTR Pin
David Crow11-Feb-08 3:26
David Crow11-Feb-08 3:26 
GeneralRe: Error transferring a CString to LPTSTR Pin
Larry Mills Sr13-Feb-08 3:03
Larry Mills Sr13-Feb-08 3:03 
GeneralShutting down or closing the COM port if no data received from device. Pin
jonsey2984710-Feb-08 10:35
jonsey2984710-Feb-08 10:35 
GeneralRe: Shutting down or closing the COM port if no data received from device. Pin
Mark Salsbery10-Feb-08 12:08
Mark Salsbery10-Feb-08 12:08 
GeneralRe: Shutting down or closing the COM port if no data received from device. Pin
jonsey2984710-Feb-08 21:04
jonsey2984710-Feb-08 21:04 
GeneralRe: Shutting down or closing the COM port if no data received from device. Pin
jonsey2984711-Feb-08 4:11
jonsey2984711-Feb-08 4:11 
GeneralRe: Shutting down or closing the COM port if no data received from device. Pin
Mark Salsbery11-Feb-08 5:49
Mark Salsbery11-Feb-08 5:49 
GeneralRe: Shutting down or closing the COM port if no data received from device. Pin
jonsey2984711-Feb-08 6:10
jonsey2984711-Feb-08 6:10 
GeneralAccessing a running instance of a program Pin
rbrunton10-Feb-08 8:06
rbrunton10-Feb-08 8:06 
GeneralRe: Accessing a running instance of a program Pin
Mark Salsbery10-Feb-08 9:25
Mark Salsbery10-Feb-08 9:25 
GeneralSDI App with a modeless dialog - plz Help Pin
Member 44313710-Feb-08 7:10
Member 44313710-Feb-08 7:10 
Questionhow search engine works Pin
Petra10-Feb-08 6:37
Petra10-Feb-08 6:37 
GeneralRe: how search engine works Pin
Hamid_RT10-Feb-08 21:05
Hamid_RT10-Feb-08 21:05 
Questionhow to make child controls transparent in a non transparent dialog Pin
swarup10-Feb-08 2:35
swarup10-Feb-08 2:35 
AnswerRe: how to make child controls transparent in a non transparent dialog Pin
David Crow11-Feb-08 3:28
David Crow11-Feb-08 3:28 
Generalmake dialog responsive even if it is running a time consuming calculation Pin
swarup10-Feb-08 2:28
swarup10-Feb-08 2:28 
GeneralRe: make dialog responsive even if it is running a time consuming calculation Pin
Mario M10-Feb-08 6:33
Mario M10-Feb-08 6:33 
GeneralRe: make dialog responsive even if it is running a time consuming calculation Pin
Mark Salsbery10-Feb-08 9:48
Mark Salsbery10-Feb-08 9:48 
Doing your lengthy process on a separate thread is the recommended way
to go.

If you don't want to use multiple threads, then your lengthy process needs
to periodically pump all Windows messages so the UI will remain
responsive.

Here's an example MFC message pump (implemented in the application class)
void CMyWinApp::PumpWaitingMessages()
{ 
    MSG msg;
    while ( ::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) ) 
    { 
        if ( !PumpMessage( ) ) 
        { 
            //::PostQuitMessage(0); 
            break; 
        } 
    } 
}

A Win32 message pump could be something like
MSG     msg;
while ( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
{
	TranslateMessage( &msg );
	DispatchMessage( &msg );
}

Note that you'll want to disable any UI components that you don't want the user
to mess with during the lengthy process.

Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

Generalvirtual function Pin
George_George10-Feb-08 2:00
George_George10-Feb-08 2:00 
GeneralRe: virtual function Pin
BadKarma10-Feb-08 13:03
BadKarma10-Feb-08 13:03 
GeneralRe: virtual functio Pin
Stephen Hewitt10-Feb-08 13:53
Stephen Hewitt10-Feb-08 13:53 

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.