flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
madmatt 20 May 2009, 10:54
Doesn't look like it's the MoveWindow Function. Are you returning from the dialog procedure correctly?
|
|||
![]() |
|
pete 20 May 2009, 11:00
I'm following the program execution with OllyDbg, and the application always gets stuck inside MoveWindow; when i use SetWindowPos, everything runs just fine…
|
|||
![]() |
|
revolution 20 May 2009, 11:49
You are setting the repaint flag, so windows is likely to call your paint function. Check your painting routines.
|
|||
![]() |
|
pete 20 May 2009, 11:55
The program doesn't intercept the painting routine of the dialog box. I checked that already; 0 or 1 for the REPAINT flag both crashes the application.
|
|||
![]() |
|
revolution 20 May 2009, 11:56
So what error do you get? Did you see where the crash happens in Olly?
|
|||
![]() |
|
pete 20 May 2009, 12:04
MoveWindow does not return; when i step through the function with Olly, a lot of subroutines get called and somewhen in there the app crashes. I don't assume there's a bug in Windows XP (SP3), so i probably have to step through the MoveWindow function and it's subroutines again to find the part that harms the execution. Do you have any suggestions?
|
|||
![]() |
|
revolution 20 May 2009, 12:20
But Olly will stop at the error. The you can see where it fails.
Also, does your dialogue box have some custom controls? The controls may get notified about the move. There are so many things that could be wrong and without any code it is impossible to say what. Try to minimise the code to the smallest possible that still causes it to fail and then post here. Although, I often find that just trying to minimise the problem is enough to reveal where the fault lies. |
|||
![]() |
|
pete 20 May 2009, 13:13
Well madmatt, you were right. In one part that was used my multiple dialog procedures, the program was a mess. One dialog procedure reserved a DWORD on the stack and then jumped to this messy subpart of another dialog procedure that didn't put the DWORD off the stack.
Thanks for your tips, revolution; still one question remains: Quote:
Just how can i see where it fails? Olly stops somewhere in nowhere and i can't get one step back. How can one track the problem down then? |
|||
![]() |
|
madmatt 21 May 2009, 10:19
Hi pete,
Sometime's where the crash actually happened isn't going to be obvious. To debug further, I place a MessageBox function in my program to indicate success up to *this* point in my program. I continue to cut and paste MessageBox after each function and procedure call until the *crash*, no message box window. This may be a strange way to debug a program, but it works for me 95% of the time. |
|||
![]() |
|
Mac2004 21 May 2009, 11:59
madmatt: I use similar method of debugging as well.
|
|||
![]() |
|
pal 21 May 2009, 16:27
Same. It is my primary method of debugging before using Ollydbg.
|
|||
![]() |
|
pete 25 May 2009, 07:42
I too used MessageBox, but it got annoying because i had to click "Ok" or something like that. The second problem i had with MessageBox was that an important window lost focus, which forced me to re-focus a window after closing a MessageBox.
When i found OutputDebugString it helped me much more; this function sends a string to the "debugger for the current application". While testing my apps, i run dbmon.exe (from the MS Platform SDK) in the background, which is the default debugger and catches all strings pushed by OutputDebugString. It is much more comfortable than MessageBox, at least for me. The reason i used Olly instead of MessageBox or OutputDebugString in this case was that i simply had no clue about WHERE to output my debug strings… |
|||
![]() |
|
Borsuc 25 May 2009, 23:30
pete wrote: Just how can i see where it fails? Olly stops somewhere in nowhere and i can't get one step back. How can one track the problem down then? _________________ Previously known as The_Grey_Beast |
|||
![]() |
|
pete 26 May 2009, 05:45
Thank you Borsuc.
|
|||
![]() |
|
Borsuc 27 May 2009, 02:21
No probs. Slow though, you'll need a fast CPU
![]() |
|||
![]() |
|
pete 27 May 2009, 06:54
Yes, i recognized that already, hehe.
|
|||
![]() |
|
comrade 27 May 2009, 07:39
Have you found out the root cause of the problem? Can you share out the .exe file?
|
|||
![]() |
|
pete 27 May 2009, 08:43
Yes, see 9th post from top!
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.