🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #1205

Re: Help on GetClientRect function

#1205
From: Scott Heyano
Date: Sun, 03 Feb 1991 21:38
19 lines
1273 bytes
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.
Technical Details
Message-ID: <14863@june.cs.washington.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mit-eddie!uw-beaver!uw-june!wolf.cs.washington.edu!slh
References: <11736@helios.TAMU.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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