Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VC++
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
 
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 6-Sep-12 0:19am
Edited 6-Sep-12 0:47am
(no name)7.9K
v2
Comments
Richard MacCutchan at 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)

  Print Answers RSS
0 OriginalGriff 350
1 Jochen Arndt 190
2 Richard MacCutchan 135
3 Sergey Alexandrovich Kryukov 130
4 DamithSL 95
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,087
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,310


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 6 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100