|
See here.
"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
|
|
|
|
|
if u can't don't make any rubbish ..i hope u got it
|
|
|
|
|
Bisua wrote: if u can't don't make any rubbish ..i hope u got it
Well, this perfeclty applies to you also: if you can't make a valid question and do not bother reading the posting guidelines, don't make any rubbish post like you just did.
|
|
|
|
|
Bisua wrote: .i hope u got it
While you clearly haven't got it.
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]
|
|
|
|
|
Now guys, perhaps we should be nice and answer the questions...
Question 1
Bisua wrote: we need 4 class for an sdi application why we need that application class ??
Answer:
Guess WE really don't need it (you might) - there are many other ways to write a program (although you may have been told to use it).
Question 2
Bisua wrote: and what is the program flow in a doc view program for an sdi appliction??
Answer:
That all depends on how you write the program.
Karl - WK5M
PP-ASEL-IA (N43CS)
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
You are not just an idiot, you also have a history of abusive behaviour towards people who actually want to help you but you're too stupid to realize that.
Go away and stop polluting this forum.
|
|
|
|
|
Genius!
|
|
|
|
|
Bisua wrote: we need 4 class
You are kidding right?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Individuality is fine, as long as we do it together - F. Burns
Help humanity, join the CodeProject grid computing team here
|
|
|
|
|
I am trying to understand how to write an efficient OnPaint routine. That is, I want my routine
to only update the part of the screen that needs to be updated. Therefore I wrote a simple program
that creates a window and displays three lines. Below is the OnPaint routine for that program:
void<br />
CMainWindow::OnPaint()<br />
{<br />
CPaintDC dc(this);<br />
<br />
RECT rect1;<br />
BOOL retValue = GetUpdateRect( &rect1 );<br />
if ( retValue != 0 ) {<br />
char *ptr = 0;<br />
*ptr = 23;<br />
}<br />
dc.BitBlt( 0, 0, maxX, maxY, &m_memDC, 0, 0, SRCCOPY );<br />
}
The code works but the routine GetUpdateRect always returns 0. I am wondering if the only way to
get GetUpdateRect to return non-zero is if the program sends (via something like SendMessage)
the WM_PAINT message.
You should also observe that in the current code, if GetUpdateRect does return a non-zero value
then the program crashes. Currently, the program never crashes.
Bob
|
|
|
|
|
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 />
|
|
|
|