Click here to Skip to main content
15,923,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMultiple Processes: Threads, Messages, Etc Pin
Eric Sanchez26-Sep-01 16:28
Eric Sanchez26-Sep-01 16:28 
Hey,
Could any one please tell me any idea on how can i solve this problem. I made a list box in which files can be added and can also be zipped. However, all of this is done in a while loop so the dialog isn't receivng any messages, kind of freezing until the loop is done. I would like to be able to click Cancel but it's not working. I tried inserting this in the middle of the loop:

CWinApp* pApp = AfxGetApp();
MSG msg;
while ( PeekMessage ( &msg, NULL, 0, 0, PM_NOREMOVE ))
pApp->PumpMessage();

but it makes it a lot slower and while the files are being zipped this won't work.
I created a worker thread but the problem is that i need to call functions like:

next = m_files.GetNextItem(next-1 ,LVNI_SELECTED );

which are non static so the compiler will give me an error. It won't work either with GUI thread. Any suggesions on how to fix this?
Thanks alot.
Regards,
Eric
GeneralRe: Multiple Processes: Threads, Messages, Etc Pin
Michael Dunn26-Sep-01 17:02
sitebuilderMichael Dunn26-Sep-01 17:02 
GeneralRe: Multiple Processes: Threads, Messages, Etc Pin
Eric Sanchez27-Sep-01 2:47
Eric Sanchez27-Sep-01 2:47 
GeneralBitmap Pin
26-Sep-01 15:16
suss26-Sep-01 15:16 
GeneralRe: Bitmap Pin
Christian Graus26-Sep-01 15:54
protectorChristian Graus26-Sep-01 15:54 
General2K and Tasks Pin
Christopher Lord26-Sep-01 15:15
Christopher Lord26-Sep-01 15:15 
GeneralRe: 2K and Tasks Pin
Tomasz Sowinski27-Sep-01 0:31
Tomasz Sowinski27-Sep-01 0:31 
GeneralRe: 2K and Tasks Pin
Christopher Lord27-Sep-01 0:40
Christopher Lord27-Sep-01 0:40 
GeneralRe: 2K and Tasks Pin
Tomasz Sowinski27-Sep-01 0:50
Tomasz Sowinski27-Sep-01 0:50 
GeneralRe: 2K and Tasks Pin
Christopher Lord27-Sep-01 0:53
Christopher Lord27-Sep-01 0:53 
GeneralRe: 2K and Tasks Pin
Anders Molin27-Sep-01 1:02
professionalAnders Molin27-Sep-01 1:02 
QuestionNeed help with d-heap analysis? Pin
26-Sep-01 11:29
suss26-Sep-01 11:29 
QuestionHow do I maximize a child frame in code? Pin
26-Sep-01 10:39
suss26-Sep-01 10:39 
AnswerRe: How do I maximize a child frame in code? Pin
26-Sep-01 10:45
suss26-Sep-01 10:45 
GeneralRe: How do I maximize a child frame in code? Pin
mspitzer26-Sep-01 11:00
mspitzer26-Sep-01 11:00 
AnswerRe: How do I maximize a child frame in code? Pin
Tomasz Sowinski27-Sep-01 0:34
Tomasz Sowinski27-Sep-01 0:34 
Generalseveral restarts when installing Windows Pin
Peter Molnar26-Sep-01 9:48
Peter Molnar26-Sep-01 9:48 
GeneralRe: several restarts when installing Windows Pin
Carlos Antollini26-Sep-01 10:06
Carlos Antollini26-Sep-01 10:06 
GeneralRe: several restarts when installing Windows Pin
Tim Smith26-Sep-01 10:37
Tim Smith26-Sep-01 10:37 
Generalseveral restarts when installing Windows Pin
Peter Molnar26-Sep-01 9:46
Peter Molnar26-Sep-01 9:46 
QuestionHow do IAdd MFC to Non-Atl snap-in? Pin
scoob26-Sep-01 9:40
scoob26-Sep-01 9:40 
GeneralMFC access to ffastun.ff* files Pin
Harold Bamford26-Sep-01 9:35
Harold Bamford26-Sep-01 9:35 
GeneralBitmaps, Clipboard, and Palettes, Oh My! Pin
#realJSOP26-Sep-01 9:33
professional#realJSOP26-Sep-01 9:33 
GeneralRe: Bitmaps, Clipboard, and Palettes, Oh My! Pin
Tomasz Sowinski26-Sep-01 9:52
Tomasz Sowinski26-Sep-01 9:52 
GeneralRe: Bitmaps, Clipboard, and Palettes, Oh My! Pin
#realJSOP26-Sep-01 10:01
professional#realJSOP26-Sep-01 10:01 

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.