what type is
BtnState
? If it's not a
bool
, and it's not set to
null
(or zero), it will evaluate to
true
.
EDIT ======================
0) Are you sure
m_pg
isn't null?
1) Try it this way:
CPage* m_pg = ((CPage*)((CGSPropertySheet*)GetParent())->GetParent());
if (m_pg)
{
m_set.EnableWindow(!m_pg->BtnState);
}