Click here to Skip to main content
16,005,141 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Heap problem?? desperately need help. Pin
Mark Salsbery1-Aug-07 10:42
Mark Salsbery1-Aug-07 10:42 
GeneralRe: Heap problem?? desperately need help. Pin
alberthyc1-Aug-07 11:05
alberthyc1-Aug-07 11:05 
GeneralRe: Heap problem?? desperately need help. Pin
Mark Salsbery1-Aug-07 11:23
Mark Salsbery1-Aug-07 11:23 
GeneralRe: Heap problem?? desperately need help. Pin
alberthyc1-Aug-07 11:32
alberthyc1-Aug-07 11:32 
GeneralRe: Heap problem?? desperately need help. Pin
Mark Salsbery1-Aug-07 11:37
Mark Salsbery1-Aug-07 11:37 
GeneralRe: Heap problem?? desperately need help. Pin
alberthyc1-Aug-07 11:46
alberthyc1-Aug-07 11:46 
GeneralRe: Heap problem?? desperately need help. Pin
Mark Salsbery1-Aug-07 11:58
Mark Salsbery1-Aug-07 11:58 
GeneralRe: Heap problem?? desperately need help. Pin
Mark Salsbery1-Aug-07 12:08
Mark Salsbery1-Aug-07 12:08 
alberthyc wrote:
i'm wondering is my functions looks appropriate? is there any better way to do this?

Just some thoughts...

Accessing a CWnd from another thread is usually best avoided unless you know exactly what
you're doing (or what MFC is doing).  Accessing the underlying HWND is ok but you have to
use thread synchronization just like for any other type of object accessed by multiple
threads.

I'm wondering if you really need a thread for this.  Maybe a timer would be more appropriate,
maybe not.

Your thread sits and spins in a loop - does it consume all your CPU time?

Make sure your memory accesses all stay within bounds.
Make sure you use thread synchronization objects if you need them.

Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

QuestionDebugging Error Pin
pheven1-Aug-07 8:50
pheven1-Aug-07 8:50 
AnswerRe: Debugging Error Pin
Michael Dunn1-Aug-07 9:31
sitebuilderMichael Dunn1-Aug-07 9:31 
AnswerRe: Debugging Error Pin
Mark Salsbery1-Aug-07 9:40
Mark Salsbery1-Aug-07 9:40 
GeneralRe: Debugging Error Pin
pheven1-Aug-07 10:50
pheven1-Aug-07 10:50 
QuestionTTS SAPI5 Pin
pablov061-Aug-07 8:14
pablov061-Aug-07 8:14 
QuestionAccess Report DB Pin
mk_le1-Aug-07 8:13
mk_le1-Aug-07 8:13 
QuestionHow to copy a file opened by other process with forbidden sharing? Pin
Vlad01-Aug-07 7:48
Vlad01-Aug-07 7:48 
AnswerRe: How to copy a file opened by other process with forbidden sharing? Pin
JudyL_MD1-Aug-07 9:38
JudyL_MD1-Aug-07 9:38 
AnswerRe: How to copy a file opened by other process with forbidden sharing? Pin
Randor 1-Aug-07 10:01
professional Randor 1-Aug-07 10:01 
GeneralRe: How to copy a file opened by other process with forbidden sharing? Pin
Vlad02-Aug-07 8:29
Vlad02-Aug-07 8:29 
GeneralRe: How to copy a file opened by other process with forbidden sharing? [modified] Pin
Vlad022-Aug-07 7:54
Vlad022-Aug-07 7:54 
AnswerRe: How to copy a file opened by other process with forbidden sharing? Pin
Peter Weyzen1-Aug-07 21:16
Peter Weyzen1-Aug-07 21:16 
GeneralRe: How to copy a file opened by other process with forbidden sharing? Pin
Vlad02-Aug-07 5:14
Vlad02-Aug-07 5:14 
Questionbetter way for executing system commands [modified] Pin
koumodaki1-Aug-07 6:30
koumodaki1-Aug-07 6:30 
AnswerRe: better way for executing system commands Pin
_AnsHUMAN_ 1-Aug-07 7:12
_AnsHUMAN_ 1-Aug-07 7:12 
AnswerRe: better way for executing system commands Pin
James R. Twine1-Aug-07 7:23
James R. Twine1-Aug-07 7:23 
AnswerRe: better way for executing system commands Pin
David Crow1-Aug-07 7:27
David Crow1-Aug-07 7:27 

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.