Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetWindowRect() problem 1

Status
Not open for further replies.

HyperEngineer

Programmer
May 8, 2002
190
US
I have the following lines in the OnCtlColor() function.

Code:
  CWnd* clientWindow = GetWindow(GW_OWNER);
  RECT MyRect;
  clientWindow->GetWindowRect(&MyRect);

The clientWindow->GetWindowRect(&MyRect) statement generates an error. It says an instruction referenced a memory location that it could not read. I tried to use memset to give the MyRect variable allocated space. I don't know what else to do. Any ideas?

HyperEngineer
If it ain't broke, it probably needs improvement.
 
What is clientWindow - is it anything valid?
 
That's what caused the error. It referred to nothing.

HyperEngineer
If it ain't broke, it probably needs improvement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top