Click here to Skip to main content
15,896,207 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: set_union question (about the parameter _Result) Pin
Stuart Dootson2-Mar-09 19:20
professionalStuart Dootson2-Mar-09 19:20 
QuestionPerformance clarification on vectors? Pin
mmayur27-Feb-09 5:58
mmayur27-Feb-09 5:58 
AnswerRe: Performance clarification on vectors? Pin
Stuart Dootson27-Feb-09 8:19
professionalStuart Dootson27-Feb-09 8:19 
Questionhelp: A C++ template question [modified] Pin
yellowine24-Feb-09 11:12
yellowine24-Feb-09 11:12 
AnswerRe: help: A C++ template question Pin
Stuart Dootson24-Feb-09 11:20
professionalStuart Dootson24-Feb-09 11:20 
GeneralRe: help: A C++ template question Pin
yellowine24-Feb-09 11:24
yellowine24-Feb-09 11:24 
GeneralRe: help: A C++ template question Pin
Stuart Dootson24-Feb-09 12:53
professionalStuart Dootson24-Feb-09 12:53 
QuestionMap access violation problem with release build Pin
Kyudos23-Feb-09 15:30
Kyudos23-Feb-09 15:30 
I get an access violation when trying to add to a map in my release build. Since it works fine in debug, and if I turn off optimisations in release, I know its something I'm doing wrong. But I don't know what...

Interestingly (?), the code that fails is in a loop which works on the first iteration, and fails on the second, suggesting perhaps a problem with initialising (or reinitialising) something.

Any help or tips very much appreciated Smile | :)

The code that fails is (bold line):

ManInfo mi; // declared outside the loop
...
// Now looping over all the things I want to add to the map...
...
// If the count is zero, we haven't added this point yet
if (m_ManMap.count(lSubmainID) == 0)
{
    mi.SubmainJunctionPt = m_pCADEngine->GetEntityPoint(pSubmainJnc->GetHandle(), 1);
    mi.LatEndPt[0] = m_pCADEngine->GetEntityPoint(pFreeEnd->GetHandle(), 1);
    mi.LatLen[0] = mi.SubmainJunctionPt.GetDistanceTo2D(mi.LatEndPt[0]);
    mi.DistToRef = mi.SubmainJunctionPt.GetDistanceTo2D(m_ManRefPt);

    m_ManMap[lSubmainID] = mi;
}
else // we've already added some, or all, of this info
{
...

I have a structure thus:
struct ManInfo
{
    Point3D SubmainJunctionPt;
    Point3D LatEndPt[2];
    double LatLen[2];
    double DistToRef;

    // Initialise in constructor
    ManInfo()
    {
        SubmainJunctionPt.Construct(NO_ELEVATION, NO_ELEVATION, NO_ELEVATION);
        LatEndPt[0].Construct(NO_ELEVATION, NO_ELEVATION, NO_ELEVATION);
        LatEndPt[1].Construct(NO_ELEVATION, NO_ELEVATION, NO_ELEVATION);
        LatLen[0] = -1.0L;
        LatLen[1] = -1.0L;
        DistToRef = -1.0L;
    }

    ManInfo& ManInfo::operator= (const ManInfo& second)
    {
        if (this != &second)
        {
             SubmainJunctionPt.Construct(second.SubmainJunctionPt);
             LatEndPt[0].Construct(second.LatEndPt[0]);
             LatEndPt[1].Construct(second.LatEndPt[1]);
             LatLen[0] = second.LatLen[0];
             LatLen[1] = second.LatLen[1];
             DistToRef = second.DistToRef;
        }
        return *this;
    }
};

And a map member variable thus:
typedef map<LONG, ManInfo> ManMap;
ManMap m_ManMap;

AnswerRe: Map access violation problem with release build Pin
Kyudos23-Feb-09 16:15
Kyudos23-Feb-09 16:15 
AnswerRe: Map access violation problem with release build Pin
Stuart Dootson24-Feb-09 8:48
professionalStuart Dootson24-Feb-09 8:48 
GeneralRe: Map access violation problem with release build Pin
Kyudos24-Feb-09 9:39
Kyudos24-Feb-09 9:39 
AnswerRe: Map access violation problem with release build Pin
Kyudos24-Feb-09 10:06
Kyudos24-Feb-09 10:06 
GeneralRe: Map access violation problem with release build Pin
Stuart Dootson24-Feb-09 10:17
professionalStuart Dootson24-Feb-09 10:17 
GeneralRe: Map access violation problem with release build Pin
Kyudos24-Feb-09 10:41
Kyudos24-Feb-09 10:41 
AnswerRe: Map access violation problem with release build - CAPITULATION! Pin
Kyudos24-Feb-09 10:38
Kyudos24-Feb-09 10:38 
GeneralRe: Map access violation problem with release build - CAPITULATION! Pin
Stuart Dootson24-Feb-09 11:13
professionalStuart Dootson24-Feb-09 11:13 
GeneralRe: Map access violation problem with release build - CAPITULATION! Pin
Rupen Patel8-Apr-10 8:41
Rupen Patel8-Apr-10 8:41 
QuestionHow to invoke IPimSrcContactNew::Create Pin
benchi200622-Feb-09 21:59
benchi200622-Feb-09 21:59 
AnswerRe: How to invoke IPimSrcContactNew::Create Pin
Stuart Dootson24-Feb-09 8:41
professionalStuart Dootson24-Feb-09 8:41 
GeneralRe: How to invoke IPimSrcContactNew::Create Pin
benchi200624-Feb-09 14:19
benchi200624-Feb-09 14:19 
GeneralRe: How to invoke IPimSrcContactNew::Create Pin
Stuart Dootson24-Feb-09 21:15
professionalStuart Dootson24-Feb-09 21:15 
Questionabout STL design Pin
followait20-Feb-09 23:06
followait20-Feb-09 23:06 
AnswerRe: about STL design Pin
«_Superman_»21-Feb-09 21:55
professional«_Superman_»21-Feb-09 21:55 
AnswerRe: about STL design Pin
Stuart Dootson22-Feb-09 13:40
professionalStuart Dootson22-Feb-09 13:40 
AnswerRe: about STL design Pin
CPallini22-Feb-09 22:22
mveCPallini22-Feb-09 22:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.