Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I new in vc++ programming. I have situation here where my progress bar not show movement at all.
On the dialog, i add in toolbox progress bar control call IDC_PROGRESS1 and create variable control on it too, call m_pbar1

C++
Bool Form1::OnInitDialog()
{
.
.
m_pbar1.setpos(20); --> able to see some changing in progress bar
.
}

I add in control button OnProgram where it will create multi threading here which going to access some dll api function.

void Form1::OnProgram()
{
.
.
create thread here>>
.
}

//programming threading, return 1 for success, 0 for error
DWORD WINAPI ProgramThread(LPVOID para)
{
.
.
dll api function call >> this function will return back the program progress
.
.
.
}

//this function below will continue update the status progress program
int program_progress(value1)
{
.
.
## i try to add m_pbar1 here --> error undeclare variable
## i try alot method e.g sendDlgItemMessage(hwnd,IDC_PROGRESS1,PBM_SETPOS,value,0); but still no luck at as i don;t know how to get hwnd
return 1; //return 1 for continue programming
}

I have check other ppl solution e.g assign
HWND hwnd = (HWND)m_hWnd;
Still not working.
So,any expert here can give me some guideline or links that i can refer to..

thanks and regards,
Simon
Posted
Updated 5-Sep-12 23:47pm
v2
Comments
Richard MacCutchan 6-Sep-12 6:05am    
Unfortunately you did not include your actual code, just some odd comments which may or may not be relevant. Please edit your question and show the actual code that is failing. For example what happens in function program_progress() and where is it called from? Given that you are new to C++ (there is no such language as VC++) and Windows programming, it may be that you trying something a bit too advanced for your knowledge and experience.

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