troubleshooting Question

Unhandled exception when adding edit box

Avatar of khairulzams
khairulzams asked on
System Programming
21 Comments1 Solution1570 ViewsLast Modified:
Hi expert

Once again, I got a problem

My program working properly before I add an edit box on my dialog. I have 3 edit boxes and its running successfully. But when I try to add another edit box, I got this error when running the program

"Unhandled exception at 0x57a9dd8b (mfc90d.dll) in ReTIME.exe: 0xC0000005: Access violation reading location 0x68f8260f."

Then the Visual Studio 2008 workspace show a code with yellow arrow.
Here, part of the code (where yellow arrow was pointing) in altsimpstr.h

      ATL_NOINLINE void Fork( _In_ int nLength )
            CStringData* pOldData = GetData();
            int nOldLength = pOldData->nDataLength;
            CStringData* pNewData = pOldData->pStringMgr->Clone()->Allocate( nLength, sizeof( XCHAR ) );
            if( pNewData == NULL )
            int nCharsToCopy = ((nOldLength < nLength) ? nOldLength : nLength)+1;  // Copy '\0'
            CopyChars( PXSTR( pNewData->data() ), nCharsToCopy,
                  PCXSTR( pOldData->data() ), nCharsToCopy );
            pNewData->nDataLength = nOldLength;
            Attach( pNewData );

How to fix it

Thank and Regard
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 21 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 21 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros