Solved

CPropertySheet

Posted on 2010-11-11
3
1,165 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 30

Accepted Solution

by:
Zoppo earned 125 total points
Comment Utility
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
Comment Utility
0
 

Author Comment

by:nchannon
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now