Solved

CPropertySheet

Posted on 2010-11-11
3
1,176 Views
Last Modified: 2012-05-10
Hi I have a problem when creating a CPropertySheet and CPropertyPage.When I run my program both debug or release mode I get an error First-chance exception at 0x773d7901 in PYDVR.exe: 0xC0000005: Access violation writing location 0x004739ec the error is generated after i call DoModal() and is generated in the file dlgprob.cpp line 931 HWND hWnd = (HWND)::AfxPropertySheet(&m_psh); The strange thing is it dosnt cause the application to fail and the property pages work fine even if i run the release version there is no crash. I tried the three ms samples CmnCtrl1 and Cmnctrl2 both do not cause the same error but running Cmnctrl3 example the same error happens I am using vs2010. Has anyone come accross this error? I don't think its my code as I have basically copyied the ms sample.
0
Comment
Question by:nchannon
3 Comments
 
LVL 31

Accepted Solution

by:
Zoppo earned 125 total points
ID: 34115354
Hi nchannon,

first-chance exception may occur in some cases without being caused by a bug - here's a short article about what first-chance exceptions are: http://support.microsoft.com/kb/105675/en-us

In short words a first-chance exception is shown by the debugger as soon as the exception occurs but before the program probably handled it. The second-chance exception is thrown if such a first-chance exception isn't handled by the application.

Of course it would be good to know the reason because it could be an indication for an error in your code - check the debug output if there's someting strange. Maybe going through the code with the debugger may even give you a hint what's the cause.

Hope that helps,

ZOPPO
0
 
LVL 5

Assisted Solution

by:greatsubash
greatsubash earned 125 total points
ID: 34118206
0
 

Author Comment

by:nchannon
ID: 34121004
Thanks Zoppo at least I can ignore the first-chance exception as it only happens the once still I think it must be a bug between XP and WIN7 as it is fine when you debug under WIN7 only throws the exception under XP.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question