By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,234 Members | 1,872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,234 IT Pros & Developers. It's quick & easy.

CBitmapButton causes unhandled exception?

P: 27
I am using VC++ 6, I am trying to add a CBitmapButton to a dialog, I followed the steps from the web page below. I got the bitmap button working but when I exit the dialog box a message appears saying 'Unhandled exception in ModelWizard.exe: 0xC0000005: Access Violation.'
I'm new to programming/MFC and this has me stumped - any help would be greatly app. Thanks
Jun 29 '06 #1
Share this Question
Share on Google+
5 Replies

Expert Mod 5K+
P: 8,916
I tried it out and it works as specified for me, perhaps it's something else that you are doing.
Jun 29 '06 #2

P: 27
I am adding the bitmap button to an existing dialog, the dialog worked fine before the bitmap code now it gives an exception when exiting from the dialog box. Is there something else that needs done? Do you have to destroy the bitmap before exiting the dialog box?
Jun 29 '06 #3

Expert Mod 5K+
P: 8,916
I didn't have to do anything, I followed exactly what the link you posted said.

I did not have to destory anything.

I am also using MSVC 6.0 and I added the button to an existing dialogue.

Just because the code appeared to work befor you added this button does not mean that there was/is not an error in it.

Have you tried trapping the exception by running you program in the symbolic debugger.
Jun 29 '06 #4

P: 27
nope, never heard of a symbolic debugger!?! How do I do that,
Jun 29 '06 #5

Expert Mod 5K+
P: 8,916
From the menu (actually there are tool bar buttons too)

Build -> Start Debug -> Go

When the exception happens the program will halt at that point and you can examine the call trace and varaibles to see if you can see the problem, which is most likely going to access to an invalid or NULL pointer.
Jun 29 '06 #6

Post your reply

Sign in to post your reply or Sign up for a free account.