Progress bar and redetecting a device
Posted on 2003-12-10
I have this problem...
I have a function (I'm using VC++ 6.0) for detecting COM Ports and showing the progress while detecting. It works fine but when the second time I call this function. The progress bar won't show correctly.
First I call "CreateThread" to create a thread to take care of progress bar. And then, I keep going on detecting COM Ports. The progress function is a dialog...so I update the progress by calling "SendMessage" and "GetDlgItem"
However, it seems the progress function stucks before I call GetDlgItem...so the whole function won't have the correct handle....Hence, it won't update the progress bar.
My problem is how can I make some adjustments to make this function work? Or is there any codes I can reference to? Or some codes I can study? I don't know if I explain well but please help me!!! >"<