ObjectARX

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

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

610 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: 614
Registered: ‎08-06-2002
Message 2 of 4 (603 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 (587 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: 614
Registered: ‎08-06-2002
Message 4 of 4 (584 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community