Click here to Skip to main content
15,881,715 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

I am using Microsoft visual C++ 8 for development.

I am loading 72 images into application.

I am trying to show a progress bar while my process is going on.i.e loading images and while this is in progress, minimize the current application and maximize the progress bar.
This is not working properly and means application shows a blank area.

I got some information in Google. Implement BackGroundWorker threads to solve this problem.
Please help me to implement threads in VC++.

Thanks in Advance.
Posted
Updated 2-Nov-10 4:06am
v2
Comments
Dalek Dave 2-Nov-10 10:06am    
Edited for Grammar and Syntax.

Here is an excellent article discussing threads in a UI application:
Using Worker Threads[^]

-PaulH
 
Share this answer
 
Comments
Dalek Dave 3-Nov-10 6:13am    
Good Link
Hello Paul Heil,

Thanks for your reply..

I will try to implement Worker threads, But i am new to this..

If u know implementation in VC++, please help me..

I will post my implementation.

Can you help me to implement background worker in VC++.?

Progress Bar Implementation:

I take a new dialog, created a new class for that and placed a progress bar control on dialog.

The following code was inserted in OnInitDialog() in progress class.

m_Progress.SetWindowPos(&wndTop,10,1,wh-150,40,SWP_SHOWWINDOW);

Here m_Progress is a variable for progress bar control.

In loading images function i am inserted the following code to show progress bar.

m_Dlg = new ProgDlg(this);
m_Dlg->Create();

Here m_Dlg is object for pogress bar class.

ProgressBar updating:

For this, i wrote one function in progress bar class and set image index to that function. call this function in for loop in loading images function.

m_Progress.SetPos(count); this code is used to update progress bar.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900