The problem is that
GetParent
doesn't get the parent class in the inheritance hierarchy, it gets the parent window in the window hierarchy. I suspect that the wizard is not a child of any other window, so
GetParent
will return NULL. Accessing something through a NULL pointer will crash your application. Even if the wizard is a child of another window
GetParent
returns a HWND, which is not an instance of
CWizardSetup
. Trying to access a member of
CWizardSetup
through the window handle will return random data, rather than the required attribute.
This is much more complicated than you need anyway. Provided
m_rtLocalStreamAccount
is either protected or public (preferably the former), then you just use it directly, e.g.
class CWizardSetup : public CPropertySheet
{
...
protected:
StreamAccount m_rtLocalSTreamAccount;
};
class CWizardRpcSetup : public CWizardSetup
{
void MyFunction()
{
DoSomethingWithTheLocalStream(m_rtLocalSTreamAccount);
}
};
You could use
this->m_rtLocalSTreamAccount
if you really wanted to, but this is unnecessary.