Click here to Skip to main content
15,924,402 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralP.S. Pin
Curi0us_George6-Mar-04 13:49
Curi0us_George6-Mar-04 13:49 
GeneralRe: Trouble with GetLogicalDrives() function Pin
P-Rex7-Mar-04 21:45
P-Rex7-Mar-04 21:45 
GeneralCould some please post a working example Pin
MeterMan6-Mar-04 12:40
MeterMan6-Mar-04 12:40 
GeneralRe: Could some please post a working example Pin
Curi0us_George6-Mar-04 13:10
Curi0us_George6-Mar-04 13:10 
GeneralRe: Could some please post a working example Pin
MeterMan6-Mar-04 14:04
MeterMan6-Mar-04 14:04 
GeneralRe: Could some please post a working example Pin
Curi0us_George7-Mar-04 12:02
Curi0us_George7-Mar-04 12:02 
GeneralRe: Could some please post a working example Pin
MeterMan7-Mar-04 16:12
MeterMan7-Mar-04 16:12 
GeneralRe: Could some please post a working example Pin
DougW486-Mar-04 22:44
DougW486-Mar-04 22:44 
win32newb wrote:
updates an edit box based on the number of times the thread runs

I'm not exactly sure what you mean by that, but I looked at your code, and I assume you want to know how many times the thread goes through the loop. One problem I saw is that you need to stop thinking linearly with threads. You call your thread, and then the line UpdateData(TRUE); may or may not be executed before the thread...so you won't always get the same results. You should use some sort of control device, like a CSemaphore so that the Ongobutton() function waits until the thread is finished. Or another method is to have your thread update your edit box directly. I've never had assert problems with using threads...here is what I usually use if I plan on using variables from my class, otherwise I just pass NULL as my second parameter:

AfxBeginThread( StartThread, static_cast<lpvoid>(this) );

If you call your thread using this, you should have access to anything defined in the calling class, as well as your controls.

Good luck, and let me know if I was any help.
GeneralRe: Could some please post a working example Pin
MeterMan7-Mar-04 5:28
MeterMan7-Mar-04 5:28 
GeneralRe: Could some please post a working example Pin
DougW487-Mar-04 5:53
DougW487-Mar-04 5:53 
GeneralRe: Could some please post a working example Pin
MeterMan7-Mar-04 6:09
MeterMan7-Mar-04 6:09 
GeneralRe: Could some please post a working example Pin
DougW487-Mar-04 6:52
DougW487-Mar-04 6:52 
Generaltoolbar like internet explorer Pin
asher_ungar6-Mar-04 12:32
asher_ungar6-Mar-04 12:32 
GeneralEdit Box data input and output hexadecimal formatted data Pin
Freddie Code6-Mar-04 8:45
Freddie Code6-Mar-04 8:45 
GeneralChange exe file in project Pin
Mazdak6-Mar-04 6:20
Mazdak6-Mar-04 6:20 
GeneralRe: Change exe file in project Pin
Prakash Nadar6-Mar-04 6:31
Prakash Nadar6-Mar-04 6:31 
GeneralRe: Change exe file in project Pin
Mazdak6-Mar-04 7:30
Mazdak6-Mar-04 7:30 
GeneralRe: Change exe file in project Pin
Joe Woodbury6-Mar-04 11:45
professionalJoe Woodbury6-Mar-04 11:45 
GeneralRe: Change exe file in project Pin
Mazdak6-Mar-04 20:00
Mazdak6-Mar-04 20:00 
Generalminimize to system tray Pin
Otty6-Mar-04 6:02
Otty6-Mar-04 6:02 
GeneralRe: minimize to system tray Pin
tn_dang22-Apr-04 3:21
tn_dang22-Apr-04 3:21 
GeneralHelp I can't figure out how to update my edit box in visual c++ mfc Pin
MeterMan6-Mar-04 5:59
MeterMan6-Mar-04 5:59 
GeneralRe: Help I can't figure out how to update my edit box in visual c++ mfc Pin
Michael Dunn6-Mar-04 6:04
sitebuilderMichael Dunn6-Mar-04 6:04 
GeneralRe: Help I can't figure out how to update my edit box in visual c++ mfc Pin
Prakash Nadar6-Mar-04 6:29
Prakash Nadar6-Mar-04 6:29 
GeneralRe: Help I can't figure out how to update my edit box in visual c++ mfc Pin
Michael Dunn6-Mar-04 6:57
sitebuilderMichael Dunn6-Mar-04 6:57 

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.