Run Time Error - Access Viol on call to DLGMODAL

Run Time Error - Access Viol on call to DLGMODAL

I have written a dialog procedure in a learning/test workspace/project and have incorporated the code into a larger program in another workspace/project and now get a Severe (157) error 0C000005- Access Violation at run time. There are no diagnostics for compile or link. The location referenced '0048BF9B'(** in the following) is in DLGDOMODAL and has the following disassembly output:
0048BF90 push ebp
0048BF91 mov ebp,esp
0048BF93 mov eax,dword ptr [ebp+10h]
0048BF96 push esi
0048BF97 push edi
0048BF98 mov edi,dword ptr [ebp+14h]
0048BF9B mov esi,dword ptr [eax] **
0048BF9D test esi,esi
0048BF9F jne _DLGDOMODAL@24+2Ch (0048bfbc)
0048BFA1 mov eax,dword ptr [edi]
0048BFA3 test eax,eax
0048BFA5 je _DLGDOMODAL@24+22h (0048bfb2)
0048BFA7 push 0FAh
0048BFA9 push eax
0048BFAA call dword ptr [__imp__GetWindowLongA@8 (00698a5c)]
0048BFB0 jmp _DLGDOMODAL@24+2Ah (0048bfba)
0048BFB2 push 0
0048BFB4 call dword ptr [__imp__GetModuleHandleA@4 (00698838)]
0048BFBA mov esi,eax
0048BFBC push 18h
0048BFBE call malloc (00445c60)

Any clues as to how to find out what is going on?

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

You can insert DFLOGM.f90 (from ...DFInclude folder) into your project and debug it. Most probably, DlgInit had failed because you forgot to move .rc file too :-).


Everything was copied - .H, .RC etc. The error actually occurs earlier on the call to DLGINIT. I guess I need to delete the resources and either copy them again or recreate them. Maybe I did not copy them correctly!

No, you don't have to delete & recreate them in general. Something must have happened on the way -- maybe you had an old resource.fd left somewhere? Also, there may be only one .rc file in the project. Maybe rebuild all would fix it. Just a guess...

Leave a Comment

Please sign in to add a comment. Not a member? Join today