how to use same variable in different procedures?
For example in the Dialog Window Proc I assign some values to an integer variable. Than I need to use this variable in another Proc such as WndProc but it does not recognize the variable in WndProc, says it is not declared. Is there a way to somehow declare a public integer that will be seen in all procedures?
examaple:
Code:
BOOL CALLBACK PieDlgProc(HWND dlghwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
int Pval1 = GetDlgItemInt(dlghwnd, txtVal1, 0, FALSE);
}
Sets a value for Pval1
Now I need to use this value in WM_PAIT,
Code:
case WM_PAINT:
{
AngleArc(ps.hdc, 400, 300, 150, 0, Pval1);
But I get error that Pval1 is not declared in WM_PAINT.