Click here to Skip to main content
15,922,015 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using Visual C++ 6 for Palm OS Dev. Pin
john john mackey24-Nov-03 11:06
john john mackey24-Nov-03 11:06 
GeneralRe: Using Visual C++ 6 for Palm OS Dev. Pin
Michael P Butler24-Nov-03 11:29
Michael P Butler24-Nov-03 11:29 
GeneralRe: Using Visual C++ 6 for Palm OS Dev. Pin
Christian Graus24-Nov-03 13:03
protectorChristian Graus24-Nov-03 13:03 
Generalpasting from program to notepad Pin
elena1234524-Nov-03 9:49
elena1234524-Nov-03 9:49 
GeneralRe: pasting from program to notepad Pin
BaldwinMartin24-Nov-03 17:18
BaldwinMartin24-Nov-03 17:18 
GeneralRe: pasting from program to notepad Pin
John R. Shaw24-Nov-03 17:20
John R. Shaw24-Nov-03 17:20 
QuestionDialog box continuous update? Pin
bradleyand24-Nov-03 9:41
bradleyand24-Nov-03 9:41 
AnswerRe: Dialog box continuous update? Pin
Andrey Del Pozo24-Nov-03 10:11
Andrey Del Pozo24-Nov-03 10:11 
The problem is that the thread that executes your for loop is the same thread that draws the GUI of your app. In order to solve your problem you have to create a workerthread. That thread must have a way to comunicate with your gui.
If your ussing MFC the safe way to do it is passing the HWND of the dialog box or the HWNDs of the controls you want to update and use SendMessage/PostMessage to update their contents.

To create a worker thread ( a worker thread does not handle any UI events, it does not own a window ) you can call:

CWinThread* AfxBeginThread(
AFX_THREADPROC pfnThreadProc,
LPVOID pParam,
int nPriority = THREAD_PRIORITY_NORMAL,
UINT nStackSize = 0,
DWORD dwCreateFlags = 0,
LPSECURITY_ATTRIBUTES lpSecurityAttrs = NULL
);

pfnThreadProc - this is your thread function,it has the following proto:
UINT MyControllingFunction( LPVOID pParam );

pParam - can be anything you want, and it is what you recive in pParam in MyControllingFunction (usualy in MFC a HWND)




"I don't want to achieve immortality through my work... I want to achieve it through not dying."
Woody Allen
GeneralRe: Dialog box continuous update? Pin
bradleyand24-Nov-03 20:41
bradleyand24-Nov-03 20:41 
GeneralWin32 Dialog Box and Date/Time Picker Control Pin
Billy Whizz24-Nov-03 9:40
Billy Whizz24-Nov-03 9:40 
GeneralRe: Win32 Dialog Box and Date/Time Picker Control Pin
BaldwinMartin24-Nov-03 17:21
BaldwinMartin24-Nov-03 17:21 
GeneralRe: Win32 Dialog Box and Date/Time Picker Control Pin
Billy Whizz24-Nov-03 22:56
Billy Whizz24-Nov-03 22:56 
GeneralRe: Win32 Dialog Box and Date/Time Picker Control Pin
Steve S25-Nov-03 2:50
Steve S25-Nov-03 2:50 
GeneralClistbox parsing,help Pin
thes3cr3t124-Nov-03 9:32
thes3cr3t124-Nov-03 9:32 
GeneralRe: Clistbox parsing,help Pin
BaldwinMartin24-Nov-03 17:27
BaldwinMartin24-Nov-03 17:27 
Questiondetermineing a variable type within the program code? Pin
Anonymous24-Nov-03 9:24
Anonymous24-Nov-03 9:24 
AnswerRe: determineing a variable type within the program code? Pin
igor196024-Nov-03 11:56
igor196024-Nov-03 11:56 
GeneralReports in VC++6.0 Pin
Hesham Amin24-Nov-03 8:54
Hesham Amin24-Nov-03 8:54 
GeneralRe: Reports in VC++6.0 Pin
Ernesto D.24-Nov-03 9:05
Ernesto D.24-Nov-03 9:05 
GeneralRe: Reports in VC++6.0 Pin
Game Tester24-Nov-03 14:04
Game Tester24-Nov-03 14:04 
Generalreceive serial xml data Pin
Anonymous24-Nov-03 8:45
Anonymous24-Nov-03 8:45 
GeneralRe: receive serial xml data Pin
Andrey Del Pozo24-Nov-03 9:39
Andrey Del Pozo24-Nov-03 9:39 
GeneralDll data space Pin
Anonymous24-Nov-03 8:35
Anonymous24-Nov-03 8:35 
GeneralReading raw data Pin
Anonymous24-Nov-03 7:48
Anonymous24-Nov-03 7:48 
GeneralRe: Reading raw data Pin
John M. Drescher24-Nov-03 8:03
John M. Drescher24-Nov-03 8:03 

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.