ObjectARX

ObjectARX

Reply
Contributor
barts007
Posts: 12
Registered: ‎10-04-2007
Message 1 of 4 (716 Views)

First-chance exception at 0x00000000 in acad.exe: 0xC0000005

716 Views, 3 Replies
11-01-2012 12:58 PM

Hi,

 

I converted this project from VS 2003 to VS 2010.

I get this exception while running it: First-chance exception at 0x00000000 in acad.exe: 0xC0000005: Access violation reading location 0x00000000.

The debugger points to this line: m_saveButton.SetFont(pFont);

If I comment this line out, the same exception occurs on the next line, and so on, as if this line is not really the culprit.

What does this mean?

Any ideas? Thanks!

Note that I’m using Win7 32bit.

 

This is the stack trace:

00000000() 
dwgtool.arx!CParamsSheet::smileysurprised:nInitDialog()  Line 1954C++
mfc90u.dll!CPropertySheet::HandleInitDialog(unsigned   int __formal=663540192, unsigned int __formal=663540192)  Line 1440C++
mfc90u.dll!CWnd::smileysurprised:nWndMsg(unsigned int   message=272, unsigned int wParam=398414, long lParam=663540192, long *   pResult=0x1b49c65c)  Line 1897C++
mfc90u.dll!CWnd::WindowProc(unsigned int   message=272, unsigned int wParam=398414, long lParam=663540192)  Line 1755 + 0x17 bytesC++
mfc90u.dll!AfxCallWndProc(CWnd *   pWnd=0x84c820c4, HWND__ * hWnd=0x0006144c, unsigned int nMsg=272, unsigned   int wParam=398414, long lParam=663540192)    Line 240 + 0x11 bytesC++
mfc90u.dll!AfxWndProc(HWND__ *   hWnd=0x0006144c, unsigned int nMsg=272, unsigned int wParam=398414, long   lParam=663540192)  Line 402 + 0x10   bytesC++
mfc90u.dll!AfxWndProcBase(HWND__ *   hWnd=0x0006144c, unsigned int nMsg=272, unsigned int wParam=398414, long   lParam=663540192)  Line 441 + 0x16   bytesC++
user32.dll!7711c4e7()  
[Frames below may be incorrect and/or   missing, no symbols loaded for user32.dll] 
user32.dll!7711c5e7()  
user32.dll!7711c590()  
user32.dll!77115294()  
user32.dll!77134f6c()  
user32.dll!7713535a()  
user32.dll!7712ea2b()  
comctl32.dll!74b12716()  
comctl32.dll!74b135b2()  
kernel32.dll!7781c583()  
usp10.dll!76c86d25()  

 

Distinguished Mentor
owenwengerd
Posts: 686
Registered: ‎08-06-2002
Message 2 of 4 (709 Views)

Re: First-chance exception at 0x00000000 in acad.exe: 0xC0000005

11-01-2012 06:57 PM in reply to: barts007

Set your breakpoint at the offending line, then when the breakpoint gets hit, inspect the values of the class members and their contents. Look for unexpected NULL pointer values. For example, if 'this' is NULL you might get the behavior you describe.

--
Owen Wengerd
ManuSoft
Contributor
barts007
Posts: 12
Registered: ‎10-04-2007
Message 3 of 4 (693 Views)

Re: First-chance exception at 0x00000000 in acad.exe: 0xC0000005

11-02-2012 01:53 PM in reply to: owenwengerd

Owen, thank you for your feedback.

 

When the exception occurs, the IDE is pointing at this line of code:

m_saveButton.SetFont(pFont);

But I'm sure the exception is really at the line before:

    m_saveButton.Create(strSave ,WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON | WS_TABSTOP,rect,this,IDC_BUTTON_SAVE);
    m_saveButton.SetFont(pFont);

 As for the null, please see the image of the Autos window at the offending line.

AutosLn1954c.png

 

Could the ‘text’ variable cause the exception or could it be the 'm_hIcon'?

Should the ‘text’ variable have a value before reaching this point (before calling the

Create method)

?

Thanks.

Distinguished Mentor
owenwengerd
Posts: 686
Registered: ‎08-06-2002
Message 4 of 4 (690 Views)

Re: First-chance exception at 0x00000000 in acad.exe: 0xC0000005

11-02-2012 02:53 PM in reply to: barts007

Sorry, I am not familiar with your code, so I don't know whether text should have a value. You need to use your knowledge of the code to determine what values should be where, then use the tools available in the debugger to determine whether those values are correct. When I'm debugging this type of problem, I set the debugger to break on the exception, then use the disassembly window to determine exactly what instruction caused the exception, then work backward to figure out where things went haywire.

--
Owen Wengerd
ManuSoft
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.