Click here to Skip to main content
15,904,023 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Diable enter key Pin
Ravi Bhavnani3-Sep-03 5:35
professionalRavi Bhavnani3-Sep-03 5:35 
GeneralRe: Diable enter key Pin
NewHSKid3-Sep-03 5:58
NewHSKid3-Sep-03 5:58 
GeneralRe: Diable enter key Pin
Ravi Bhavnani3-Sep-03 6:01
professionalRavi Bhavnani3-Sep-03 6:01 
GeneralRe: Diable enter key Pin
valikac3-Sep-03 6:00
valikac3-Sep-03 6:00 
QuestionHow to capture ENTER key in single line edit box? Pin
melwyn3-Sep-03 4:40
melwyn3-Sep-03 4:40 
AnswerRe: How to capture ENTER key in single line edit box? Pin
Ravi Bhavnani3-Sep-03 5:37
professionalRavi Bhavnani3-Sep-03 5:37 
GeneralProblem with thread Pin
Majid Shahabfar3-Sep-03 4:14
Majid Shahabfar3-Sep-03 4:14 
GeneralRe: Problem with thread Pin
Iain Clarke, Warrior Programmer3-Sep-03 5:52
Iain Clarke, Warrior Programmer3-Sep-03 5:52 
It's no great shock that the CPU load is 100%.
After all...

  while (m_isRunning == 1)
    pEventLine->Start ();
  ...
}

void CEventLine::Start ()
{
}


simply calls Start again and again and again... with no pause for "breath". It would be the same
if you put this code in your main thread. You have a few choices...

a) Put up with it. Assuming this is only for a brief duration.
b) Put up with it, but make it less of a nuisance. I've not used MFCs threads, and MFC is poor at sharing,
but you can lower thread priority to make other threads more responsice.
DWORD dwID;
hScanThread = ::CreateThread (NULL, 0, DoScan, this, CREATE_SUSPENDED, &dwID);
if (hScanThread == NULL)
{
  DWORD   dwError = ::GetLastError ();
} else
::SetThreadPriority (hScanThread, THREAD_PRIORITY_HIGHEST);


c) Put a delay (sleep) between each iteration of the loop. This would have to be short.
d) Some other tactic depending on the contents of CEventLine::Start ().

Iain.
GeneralRe: Problem with thread Pin
Brad Sokol3-Sep-03 5:56
Brad Sokol3-Sep-03 5:56 
GeneralRe: Problem with thread Pin
Iain Clarke, Warrior Programmer3-Sep-03 6:02
Iain Clarke, Warrior Programmer3-Sep-03 6:02 
GeneralRe: Problem with thread Pin
Scott H. Settlemier3-Sep-03 10:18
Scott H. Settlemier3-Sep-03 10:18 
GeneralWinCVS and Visual Studio 6 Pin
Jerome Conus3-Sep-03 3:57
Jerome Conus3-Sep-03 3:57 
GeneralRe: WinCVS and Visual Studio 6 Pin
Stefan Pedersen3-Sep-03 5:23
Stefan Pedersen3-Sep-03 5:23 
GeneralRe: WinCVS and Visual Studio 6 Pin
Jerome Conus3-Sep-03 19:07
Jerome Conus3-Sep-03 19:07 
GeneralRe: WinCVS and Visual Studio 6 Pin
Stefan Pedersen3-Sep-03 22:58
Stefan Pedersen3-Sep-03 22:58 
GeneralRe: WinCVS and Visual Studio 6 Pin
Rasqual Twilight4-Sep-03 2:15
Rasqual Twilight4-Sep-03 2:15 
QuestionEscape URLs? Pin
Dominik Reichl3-Sep-03 3:42
Dominik Reichl3-Sep-03 3:42 
AnswerRe: Escape URLs? Pin
Iain Clarke, Warrior Programmer3-Sep-03 5:42
Iain Clarke, Warrior Programmer3-Sep-03 5:42 
GeneralRe: Escape URLs? Pin
Dominik Reichl3-Sep-03 6:21
Dominik Reichl3-Sep-03 6:21 
GeneralRe: Escape URLs? Pin
David Crow3-Sep-03 11:02
David Crow3-Sep-03 11:02 
AnswerRe: Escape URLs? Pin
Ravi Bhavnani3-Sep-03 5:44
professionalRavi Bhavnani3-Sep-03 5:44 
GeneralRe: Escape URLs? Pin
Dominik Reichl3-Sep-03 6:20
Dominik Reichl3-Sep-03 6:20 
GeneralRe: Escape URLs? Pin
David Crow3-Sep-03 11:02
David Crow3-Sep-03 11:02 
GeneralDisable Menu Items Pin
Jay Hova3-Sep-03 3:05
Jay Hova3-Sep-03 3:05 
GeneralRe: Disable Menu Items Pin
Jason Henderson3-Sep-03 3:15
Jason Henderson3-Sep-03 3:15 

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.