|
i had seen some sample codes with onmousemove. whats the purpose of invalidate() how to change the icon in the button? i cant understand what we are doing in drawitem
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|
|
deeps_cute wrote: whats the purpose of invalidate() how to change the icon in the button? i cant understand what we are doing in drawitem
You will find all these things in MSDN .
|
|
|
|
|
I recommend reading "Programming Windows, Fifth Edition" by Charles Petzold.
Invalidate is used to inform Windows that the window needs redrawing. When the thread's input queue is otherwise idle, Windows will generate a WM_PAINT message for any window that has an invalid region. This has two effects: it centralises all painting in the WM_PAINT handler, and it defers painting until all the user's input has been processed. To inform Windows that an area of the window needs repainting, use InvalidateRect or InvalidateRgn . Multiple calls to InvalidateRect or InvalidateRgn build up an invalid region.
In your WM_PAINT handler, you can find out from the device context which areas of the window are invalid and hence need repainting. The PAINTSTRUCT returned by BeginPaint (from MFC, the CPaintDC 's m_ps member) has a member rcPaint which is the bounding box of the invalid region. If you want to get the invalid region itself, you can call GetUpdateRgn but you need to call it before BeginPaint (i.e. before constructing your CPaintDC for an MFC window).
|
|
|
|
|
deeps_cute wrote:
hi i have to change the image of the button when we move mouse on it or clicked. i cant understand OnMouseMove function. can anyone help me pls.
sorry.. but you have to practice it yourself.. try making demo application!
|
|
|
|
|
I don't get the attitude of these people. They want help and if you speak the reality to them, they will downvote you. Idiots. I will give my 5 to bring it up, but my vote is silver and so has less weightage... Anyway this votes doesn't matter. I hate the people who ask for help and then vote 1 when you tell them the truth
|
|
|
|
|
brahmma wrote: hate the people who ask for help and then vote 1 when you tell them the truth
leave them dude.. is this voting system hardly matter to u me or anybody!
|
|
|
|
|
Hi,
I'm getting the following exception as follows, while executing in release version:-
unhandled exception at 0x7c910f29 in ere.exe: 0xC0000005: Access violation reading location 0x00000200.
And also if i debug, it is telling there is some problem in Cabc::~Cabc(void). But this kind of distructor i never written.
Any clues please?
Thanks
Raji
|
|
|
|
|
Meomory allocated by your code is corrupted, or you have used it wrong way(out of index etc.).
But withoug seeing code its difficult to guess.
|
|
|
|
|
RajiRaghu wrote: reading location 0x00000200
That sounds like you've dereferenced a NULL pointer somewhere, (and either using something inside a large struct, or you've incremented that pointer a few times before it's crashed)
|
|
|
|
|
While checking Disassembly, the following lines are displyed. That's where it crashes.. But unable to know what it means.
0058FC93 call dword ptr [__imp_ATL::CStringT<char,strtraitmfc_dll<char,atl::chtraitscrt<char> > >::~CStringT<char,strtraitmfc_dll<char,atl::chtraitscrt<char> > > (0BEFDB8h)]
0058FC99 lea ecx,[esi+0F4h]
0058FC9F call dword ptr [__imp_ATL::CStringT<char,strtraitmfc_dll<char,atl::chtraitscrt<char> > >::~CStringT<char,strtraitmfc_dll<char,atl::chtraitscrt<char> > > (0BEFDB8h)]
0058FCA5 lea ecx,[esi+0F0h]
0058FCAB call dword ptr [__imp_ATL::CStringT<char,strtraitmfc_dll<char,atl::chtraitscrt<char> > >::~CStringT<char,strtraitmfc_dll<char,atl::chtraitscrt<char> > > (0BEFDB8h)]
0058FCB1 lea ecx,[esi+0ECh]
0058FCB7 call dword ptr [__imp_ATL::CStringT<char,strtraitmfc_dll<char,atl::chtraitscrt<char> > >::~CStringT<char,strtraitmfc_dll<char,atl::chtraitscrt<char> > > (0BEFDB8h)]
0058FCBD lea ecx,[esi+0E8h]
0058FCC3 call dword ptr [__imp_ATL::CStringT<char,strtraitmfc_dll<char,atl::chtraitscrt<char> > >::~CStringT<char,strtraitmfc_dll<char,atl::chtraitscrt<char> > > (0BEFDB8h)]
0058FCC9 lea ecx,[esi+0E4h]
0058FCCF call dword ptr [__imp_ATL::CStringT<char,strtraitmfc_dll<char,atl::chtraitscrt<char> > >::~CStringT<char,strtraitmfc_dll<char,atl::chtraitscrt<char> > > (0BEFDB8h)]
0058FCD5 lea ecx,[esi+0E0h]
0058FCDB call dword ptr [__imp_ATL::CStringT<char,strtraitmfc_dll<char,atl::chtraitscrt<char> > >::~CStringT<char,strtraitmfc_dll<char,atl::chtraitscrt<char> > > (0BEFDB8h)]
0058FCE1 mov eax,dword ptr [esi+0D8h]
Thanks
Raji
|
|
|
|
|
Where does call stack takes you in the code ?
You have not your code, BTW.
|
|
|
|
|
Carefully checking the code of the class should reveal the problem. If you are still stuck, it sounds like it could be crashing in the destructor of one of the class members. To debug these, add an empty Cabc::~Cabc() {} function and set a breakpoint in it. Then you can single step through the destructors of the members.
Peter.
|
|
|
|
|
Hi altogether,
Creating a new MDI Child, create the controls on the View, initialize a Grid with data.
It flickers on the screen during the hole creation.
At the moment i use a LockWindowUpdate on the MainFrame and an UnLockWindowUpdate at the end of
initialisation.
But it provokes some display-irregularities, for example the textboxes which are getting the focus
won't be redrawn ( even a textbox.RedrawWindow() or textbox.Invalidate() doesn't refresh it )
A SetRedraw(False) works only for the view, not for new views in creation mode.
Does someone have an idea how professional applications resolves this problem of flickering?
Big thanks
|
|
|
|
|
|
Thanks for the docs
it's very detailed, which is hard for me, but i work on it
|
|
|
|
|
Am set a icon on button by
m_Clean.SetIcon(IDI_CLEAN_NO,(int)BTNST_AUTO_DARKER);
when the click event of other button is called am disable this button by
m_Clean.EnableWindow(FALSE)
Button is disabled but icon is disappered.how to display button with icon when that is in disable state.
|
|
|
|
|
janpoo wrote: m_Clean.SetIcon(IDI_CLEAN_NO,(int)BTNST_AUTO_DARKER);
CButton::SetIcon takes one paramter, isn't it?
|
|
|
|
|
SetIcon has a Hicon that you cal use of LoadIcon
|
|
|
|
|
janpoo wrote: Button is disabled but icon is disappered.how to display button with icon when that is in disable state.
have a look at CBitmapButton class in MSDN!
|
|
|
|
|
Well first of all thanks for telling me to buy "Charles Petzold" (Hats off to the author)but im little bit confused that the book was written in 1998 and will it hold true for todays OSs like XP & vista(I hav 5th edition) or is there any latest edition of that.
Further, I wnna know wat to use VC++6.0 or VS2005.
Although the answer would be VS2005 but wont i be illiterate about VC6 or will it cover that too.
Spread wat u Know!
|
|
|
|
|
IMHO you should start with VC++6.0. While MS provides compatibility with the earlier API's many of the API's are deprecated, and are replaced with the new ones. But in your case it won't make a lot of difference and you should be able to run the applications in Charles Petzold on the OS's like XP. On Vista however there could be some administrative privileges etc that would need some tweaking.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
_AnShUmAn_ wrote: you should start with VC++6.0
AnShUmAn, VC6 compiler is far from being compliant to the Standard C++.
i really don't get the point in advising a beginner into this direction rather that VS2003 or even better VS2005 !
|
|
|
|
|
Are you aware this was your 7000th Message??
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|
|
|
Even I knew it from his link[^]
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir?
Dr.Brad :Well,I just replied to everything Graus did and then argued with Negus for a bit.
|
|
|
|