i have this code for app termination. it should close the handles of the files associated with their respective windows...
close_handles:
cmp noMdiChild,0
je done_close_handles
invoke SendMessage,hMdi,WM_MDIGETACTIVE,0,0
mov hCurrentWindow,eax
invoke GetWindowLong,eax,GWL_USERDATA
invoke CloseHandle,[eax.MdiStruct.hFile]
invoke SendMessage,hWnd,WM_MDIDESTROY,hCurrentWindow,0
dec noMdiChild
jmp close_handles
When i close the app it gives an error on memory access that is not for reading. can someone help me out?
I''m using SendMessage,hMdiClient,WM_USER+100,0,0 But the mdiproc doesnt recieve the message. Why the hell would that be?
Well...i guess the problem is how to send messages to mdi child proc.
Could we see a little more code?
You could try to use a message box to see if the said handles actually exist, for debugging..
invoke MessageBox, 0, hex$(handle), 0, 0
where handle is the suspect handle
;;;;;;;;;;;;
Or run it in a debugger and see better what is going on with the code while stepping the code.
Quote from: zedd151 on November 19, 2020, 12:23:43 PM
Could we see a little more code?
Why, is your crystal ball not working?
Quote from: xandaz on November 19, 2020, 09:44:57 AM
Well...i guess the problem is how to send messages to mdi child proc.
look at Hutch example for send messages between two programs,maybe you need too register custom messages to make them work?
I think you should add some error checking code,checking for return eax==NULL and use a messagebox,because later down in the code NULL pointer gives you that error on memory access
sometimes its just forget to addr filename,instead of just filename in invoke
@JJ
crystall ball sounds like a great name for a debugger :biggrin:
Thanks guys. I've tried also PostMessage and MdiProc doesn't recieve the message....
did something stupid. I subclassed the MDIClient window and call both CallWindowProc and DefMdiChildProc. It accepts the message