Click here to Skip to main content
12,945,706 members (48,399 online)
Rate this:
Please Sign up or sign in to vote.
See more:
I have written only this code in MDI application
My toolbar button gets removed by On Button.
The issue is that If I run and test the application to remove the button two or three times , The next time I dont require to press button,toolbar button gets automatically removed.Even after clean and rebuild ,even after closing project and
Rebuiding again toolbar button does not reappear.What is this bug or intellisence
Can anyone tell me What is this ?

void CMerilisaRApp::OnButton()

void CMainFrame::ApplyPolicy(void)
Posted 19-Sep-12 0:45am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You should first add a test for that button existing. You should also use button identifiers rather than indices in case your code gets called multiple times. Are you really sure that you want this removed rather than disabled?
adityarao31 19-Sep-12 7:34am
Yah your suggestion is good ,but I am sure code is inserted at a place and unless
click event is raised it is not getting called,this is something very strange,I am running application and finding that button is not there
Richard MacCutchan 19-Sep-12 8:34am
It's impossible to suggest anything more since we do not know what is going on in your program. Unfortunately the only way to make progress with issues like this is to spend time with the debugger.
adityarao31 19-Sep-12 10:32am
Perhaps what you say Is Right,but I feel Visual Studio 2010 is not so stable version
Richard MacCutchan 19-Sep-12 10:46am
No, I'm pretty sure you are doing something wrong, but, as I said, without a lot more information it's impossible to guess what.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month
OriginalGriff 4,899
CHill60 3,170
Maciej Los 2,443
Jochen Arndt 1,910
ppolymorphe 1,775

Advertise | Privacy | Mobile
Web01 | 2.8.170518.1 | Last Updated 19 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100