check of visible for CStatic

Hallo, I have the following code:

1
2
3
4
5
6
7
8
9
10
CStaticEx m_pStaticField;
RWCString m_szValue;
setWindowText4Control(pStaticField,szValue);


void setWindowText4Control(CWnd* pStaticControl, RWCString myText)
{
   if(pStaticField->IsWindowVisible())
     pStaticField->SetWindowText(myText);
}


My problem is, that the if statement is always false. But I need to know if the pStaticField is visible or not. Have anyone a solution for my problem?
What do you mean by visible?

Windows maintains a visible/invisible flag for windows. IsWindowVisible returns the state of the flag. This may not be what you mean by being visible.
Topic archived. No new replies allowed.