I am trying to call the function GetParent() of CWnd class. Every time there is an exception thrown. I'm calling the function from a working thread.
This is the line that causes the exception: CWnd* parent = this->GetParent();
I've also tried "GetParent()->PostMessage(........);", and still the exception is thrown.
I'm using this method in a CDialog.
I have noticed that the CWnd member m_hWnd is sometimes 0x00000000 or 0x00000001. In a different computer I don't get this exception. Is it a problem in the project settings or in my code?