mrhicks
May 16th, 2001, 05:39 PM
Hello,
I have a form that displays a progress bar to show the progress an the current operation. On the form is a timer that is suppose to update the progress bar based upon the start time, current time and the average overall time to complete the process. Within the timer it call certain function that are created using VC++. The problem is that the progress bar isn't updating in real time. It appears that when the a call is made to the VC DLL that it pauses operation of the timer. This makes sense since VB is a single threaded application ( at least from what I understand ). So my options ( from my limited expousre to VB ) are
1) Get the VC++ developers to create a thread and spin off the process. This way it gives back control to the VB code. This is the best solution I feel, but since this portion of the code is froze there is no way I will be able to implement this solution.
2) Is create a seperate thread that only deals with update this progress bar, but from what I have read threads are not that safe in VB.
3) Maybe subclass the WinProc and use this to update the progress bar in some fashion.
I figure my best solution, currently, is to implement a thread, but I need real good reliablity for this apllication. Does anyone have any other suggestions?
Mark
I have a form that displays a progress bar to show the progress an the current operation. On the form is a timer that is suppose to update the progress bar based upon the start time, current time and the average overall time to complete the process. Within the timer it call certain function that are created using VC++. The problem is that the progress bar isn't updating in real time. It appears that when the a call is made to the VC DLL that it pauses operation of the timer. This makes sense since VB is a single threaded application ( at least from what I understand ). So my options ( from my limited expousre to VB ) are
1) Get the VC++ developers to create a thread and spin off the process. This way it gives back control to the VB code. This is the best solution I feel, but since this portion of the code is froze there is no way I will be able to implement this solution.
2) Is create a seperate thread that only deals with update this progress bar, but from what I have read threads are not that safe in VB.
3) Maybe subclass the WinProc and use this to update the progress bar in some fashion.
I figure my best solution, currently, is to implement a thread, but I need real good reliablity for this apllication. Does anyone have any other suggestions?
Mark