|
BobInNJ wrote: CPaintDC dc(this);
RECT rect1;
BOOL retValue = GetUpdateRect( &rect1 );
try the statement sequence in the following order:
RECT rect1;
BOOL retValue = GetUpdateRect( &rect1 );
CPaintDC dc(this);
Because, from documentation [^]:
BeginPaint automatically validates the update region, so any call to GetUpdateRect made immediately after the call to BeginPaint retrieves an empty update region.
(CPaintDC constructor eventually calls BeginPaint ).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks for your response. I now understand what is going on.
Bob
|
|
|
|
|
I'm doing something very similar but in OnDraw() instead. GetUpdateRect() always returns an empty region. It's an SDI application. Any clues?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Since the CPaintDC is created in the view OnPaint method (that in turn calls OnDraw ), I think you've to override OnPaint , for instance:
void MyView::OnPaint()
{
GetUpdateRect(&m_rc);
CPaintDC dc(this);
OnPrepareDC(&dc);
OnDraw(&dc);
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You can get the same info from dc.m_ps.rcPaint as well.
--Mike--
Dunder-Mifflin, this is Pam.
|
|
|
|
|
Mike,
Thanks for the response. I noticed that the item you mentioned gives me exactly what I want
and therefore it is very useful. However, m_ps is a public data member of the class. Therefore,
I do not like the idea of using public data. Is using public data such a bad idea? I am not sure.
Bob
|
|
|
|
|
Hi gurus!
I coded an app that searches for another window to overlay it. I used SetLayeredWindowAttributes to make a color transparent in my window. When the the window with right handle was found i want to set place my window over it. For that i created a timer that runs every 10ms. To place my window over the other i used
::SetWindowPos(hndWin, hndOverlayWin, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
That works. But when hndWin (that one that should be overlayed) is in background of another window...and i click in hndwin it shortly flickers and the it's send back to background. But when i click a control in my overlaying transparent window the underlying window comes to front. But not if i click an area in the window that's overlayed.
The next thing is that the overlayed window is minimized and clicked in the taksbar, both windows should appear in front.
I'm happy if someone can help!!!
Thank you!
|
|
|
|
|
Has anybody experienced this?
I just installed IE 8 and Vista SP2. I'm supporting several VC++ 6.0 (MFC) projects and need to keep it alive on my system.
Now that these are installed, I can open workspaces and recent files, however if I select File-Open in Visual C++ I get nothing (no dialog). If I do it a couple more times VC++ crashes and closes. If I try using the toolbar or "Ctrl-O", VC++ crashes immediately.
Help!
- Mark
|
|
|
|
|
Mark,
I am thinking that the version of VC++ 6.0 that is installed on your machine was damaged or
altered by the installation of IE 8 or Vista SP2. This could be related to a new version of a DLL.
I would address this issue by reinstalling VC++ 6.0.
Bob
|
|
|
|
|
Mark C. Malburg wrote: I just installed IE 8 and Vista SP2. I'm supporting several VC++ 6.0 (MFC) projects and need to keep it alive on my system.
All the more reason not to mess with a stable system.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
True. I did get some significant improvement out of Outlook and the operating system in general. But I seem to be paying the price with my 11 year old IDE.
|
|
|
|
|
Perhaps MFC DLL hell?
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
I had the same problem under XP.
I installed SP6 for VC++ and it fixed the problem.
Google: Visual C++ 6.0 service pack 6 download
|
|
|
|
|
Thanks! That's brought it back. Life is good again.
|
|
|
|
|
Hallo friends,
I need to enable the auto scrolling feature in my CRichEditView SDI Application , that i must not everytime scroll down with the mouse, please help.
i use the following code in CTest_View.cpp but it did not work:// class CTest_View: public CRichEditView
BOOL CTest_View::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style &=~ (ECO_AUTOHSCROLL | ECO_AUTOVSCROLL);
cs.style |= (WS_HSCROLL | WS_VSCROLL);
cs.style |= (ES_MULTILINE | WS_HSCROLL | WS_VSCROLL | ES_DISABLENOSCROLL);
return CRichEditView::PreCreateWindow(cs);
}
|
|
|
|
|
Source code is following:
<br />
<br />
#pragma once<br />
#include "afxwin.h"<br />
<br />
<br />
<br />
class AFX_EXT_CLASS CSuiBianEdit : public CEdit<br />
{<br />
DECLARE_DYNAMIC(CSuiBianEdit)<br />
<br />
public:<br />
CSuiBianEdit();<br />
virtual ~CSuiBianEdit();<br />
<br />
protected:<br />
DECLARE_MESSAGE_MAP()<br />
};<br />
<br />
<br />
<br />
#include "stdafx.h"<br />
#include "SuiBianEdit.h"<br />
#include ".\suibianedit.h"<br />
<br />
<br />
<br />
IMPLEMENT_DYNAMIC(CSuiBianEdit, CEdit)<br />
CSuiBianEdit::CSuiBianEdit()<br />
{<br />
}<br />
<br />
CSuiBianEdit::~CSuiBianEdit()<br />
{<br />
}<br />
<br />
<br />
BEGIN_MESSAGE_MAP(CSuiBianEdit, CEdit)<br />
END_MESSAGE_MAP()<br />
<br />
|
|
|
|
|
Is it possible to write a program in C + + by means of the diary?
thank you
soso
|
|
|
|
|
You mean you want to use your diary to write a program?
|
|
|
|
|
yes, I want to use my diary to write a program (C++ Code),how Do I do?
thanks
thank you
soso
|
|
|
|
|
1. Make sure that your diary has all the necessary libraries. You'll find these under December 12th
2. Your diary has to be ISO/IEC 14882:2003 compliant. Note: Pink diaries are not compliant (besides, only girls use these)
3. The compiler that comes with your diary must not put any secrets into the compiled binaries. Please check with your local diary dealer.
Once these specs are met you're good to go!
|
|
|
|
|
Yes!
On the first day- only write #include statements.
On the second day- write function definition for main
On the following day- write one and only one line of code
and so on and so forth according to your diary schedule.
or
do you want to write a program that allows the user to maintain his day to day work in the form of a diary.;
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
Really I want to write a robot program how many days I need to write it a CENTURY ?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
No! The ANSI C++ standards explicitly forbids this!
The narrow specialist in the broad sense of the word is a complete idiot in the narrow sense of the word.
Advertise here – minimum three posts per day are guaranteed.
|
|
|
|
|
Yes its possible if you want to have nice diary you need to write a graphic diary.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Yes, but remember to keep it locked so that your younger sibling does not get a peek.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|