Unhandled exception in *.exe: 0xC0000005: Access Violation.

Started by minor28, November 06, 2009, 03:31:08 PM

Previous topic - Next topic

minor28

I have a Dialog app with a tab control with 7 tabs. The tabs are created om the MainDlg.


.if eax==WM_INITDIALOG
...
;Create the tab dialogs
invoke CreateDialogParam,hInstance,IDD_TAB1,hTab,addr Tab1Proc,0
mov hTabDlg,eax
invoke CreateDialogParam,hInstance,IDD_TAB2,hTab,addr Tab2Proc,0
mov hTabDlg[4],eax
invoke CreateDialogParam,hInstance,IDD_TAB3,hTab,addr Tab3Proc,0
mov hTabDlg[8],eax
invoke CreateDialogParam,hInstance,IDD_TAB4,hTab,addr Tab4Proc,0
mov hTabDlg[12],eax
invoke CreateDialogParam,hInstance,IDD_TAB5,hTab,addr Tab5Proc,0
mov hTabDlg[16],eax
invoke CreateDialogParam,hInstance,IDD_TAB6,hTab,addr Tab6Proc,0
mov hTabDlg[20],eax
invoke CreateDialogParam,hInstance,IDD_TAB7,hTab,addr Tab7Proc,0
mov hTabDlg[24],eax
...


When I close the main dlg I get the unhandled exception. If I comment out tab3,4,6 and 7 it works. The exception occur if one or more of these tabs are created.


.elseif eax==WM_CLOSE
invoke EndDialog,hWin,NULL
.else
mov eax,FALSE
ret
.endif
mov eax,TRUE
ret


A breakpoint on EndDialog and steping further goes over ret to user32.dll address 7E368734 no matter if all tabs are created or not. The exception occurs on address 7E378EF7 a bit furter in user32.dll.

with tab3 uncommented and the tabdlg is cleaned from code the exception still occurs.

Now I am out of ideas how to solve this problem and I hope on outside ideas.

minor28

I found it.

In common for the four erroneous tabs is richedit controls. In operation I didn't notis anything only when closing the app. What was wrong was that I loaded Richedit.dll in WM_INITDIALOG message of the MainDlg. Moving it before createing the MainDlg eleminated the error.


dedndave

we all get error c0000005 at one point or another - lol
i was going to change my nic to c0000005

Farabi

Quote from: dedndave on November 07, 2009, 02:43:49 AM
we all get error c0000005 at one point or another - lol
i was going to change my nic to c0000005

You'll frustated anyone who see that nick, or even worse, they debugging you.  :green
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"