Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mit-eddie!uw-beaver!uw-june!wolf.cs.washington.edu!slh From: slh@wolf.cs.washington.edu (Scott Heyano) Newsgroups: comp.windows.ms.programmer Subject: Re: Help on GetClientRect function Summary: grrrrrrrr Message-ID: <14863@june.cs.washington.edu> Date: 3 Feb 91 21:38:33 GMT References: <11736@helios.TAMU.EDU> Sender: news@cs.washington.edu Reply-To: slh@wolf.cs.washington.edu (Scott Heyano) Distribution: usa Organization: Computer Science & Engineering, U. of Washington, Seattle Lines: 19 In article <11736@helios.TAMU.EDU> tony@cs.tamu.edu (Tony Encarnacion) writes: [stuff] | HDC hDC; | LPRECT lpRect; | | switch (iMessage) | { | ... | case WM_RBUTTONDOWN: | GetClientRect (hWnd, lpRect); /* <<-- this is where it bombs */ | hDC = GetDC (hWnd); /* out; */ | InvertRect (hDC, lpRect); | ReleaseDC (hWnd, hDC); [stuff] the declaration should be for a RECT, not a an LPRECT, and the uses should be taking the addr of the declared RECT. So, you have not declared storage for a RECT struct, just a pointer to one and the call to GetClientRect() writes into memory at god know's where.