|
Hi All,
when I get the client rect, I used to pass GetClientRect(rect);
but in many places i have seen that GetClientRect(rect); and GetClientRect(&rect); interchangeably. but the result is same.
Actually what is happening in teh above scenario.
SaRath.
"Don't Do Different things... Do Things Differently..."
|
|
|
|
|
SaRath. wrote: when I get the client rect, I used to pass GetClientRect(rect);
but in many places i have seen that GetClientRect(rect); and GetClientRect(&rect); interchangeably. but the result is same.
GetClientRect(rect);
In this scenario we pass object as Value
GetClientRect(&rect);
In this scenario we pass object as Reference
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
A_LaxmanGetClientRect(&rect);
In this scenario we pass object as Reference
false... we pass the object by pointer.
in this case, the prototype of the function is not GetClientRect(RECT&); but GetClientRect(RECT*);
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
When GetClientRect(RECT&); prototype used??
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
|
The CWnd::GetClientRect function actually requires an argument of type “pointer to RECT ” -- RECT * , or LPRECT .
Nevertheless, this function can be used in more contexts:
RECT rect1;
GetClientRect(&rect1);
<br>
CRect rect2;
GetClientRect(&rect2);
CRect rect3;
GetClientRect(rect3);
The design of CRect class allow you to use it with Windows functions that actually require LPRECT .
-- modified at 6:10 Tuesday 6th June, 2006
|
|
|
|
|
Thanks for the detailed reply.
when I have checked the MFC defintion of CRect, I could find that
the operators are defined as follows
operator LPRECT() throw();
operator LPCRECT() const throw();
SaRath.
"Don't Do Different things... Do Things Differently..."
|
|
|
|
|
see GetClientRect() in MSDN
void GetClientRect( LPRECT lpRect ) const;
Actual argument needed is of type LPRECT
If you give GetClientRect(rect) or GetClientRect(&rect)both returns same because CRect has got .operator LPRECT() which automatically get invoked if you pass rect. But i tell u that &rect is more correct.
Rin
|
|
|
|
|
See prev post by Viorel
SaRath.
"Don't Do Different things... Do Things Differently..."
|
|
|
|
|
sory i just saw the same
Rin
|
|
|
|
|
Hi All,
Can anyone tell me how to obtain a crash dump?? I have Visual Studio 6 on my machine.
Thanks and Regards,
Anil
|
|
|
|
|
|
Thanx .... I think this will serve my purpose
|
|
|
|
|
It surely will . And you are always welcome.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Anil_vvs wrote: Can anyone tell me how to obtain a crash dump?? I have Visual Studio 6 on my machine.
From where do you want to obtain the crash dump ?
suhredayan There is no place like 127.0.0.1
|
|
|
|
|
From the development setup
|
|
|
|
|
Anil_vvs wrote: how to obtain a crash dump??
Just generate a "MEMORY.DMP" this way (MSDN)[^].
Maxwell Chen
|
|
|
|
|
|
I am using an edit box and i want to know the every charecter which is being typed, before showing it is displayed in the edit box.
Can we handle this.
Plz help me.
THANKYOU
KIRAN
|
|
|
|
|
|
what exactly i want is i have written a chat application. As in yahoo mesngr
we type out message and press enter, then automatically the send button is pressed. So i want to implement the same in my code.
Can u help me
KIRAN
|
|
|
|
|
set the "Send" button as the default button (with CWindow::SetDefId() ) so that an Enter key press will press this button.
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
kiran.pinjarla wrote: I am using an edit box and i want to know the every charecter which is being typed
As toxcct said, handle the EN_CHANGE notification. In addition or as an alternative, you can handle WM_CHAR in your CEdit -derived class.
There you can 'eat' characters before CEdit even gets to see them.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
kiran.pinjarla wrote: I am using an edit box and i want to know the every charecter which is being typed, before showing it is displayed in the edit box.
Here is another notification event EN_UPDATE that is fired before updating the Edit control.
This notification message is sent after the control has formatted the text, but before it displays the text.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
which variable does represent the character been pressed. What i want is whether Enter is pressed.
KIRAN
|
|
|
|