Search found 10756 matches

by madshi
Sat Aug 07, 2004 7:05 am
Forum: madCodeHook
Topic: Hooking C++ member function
Replies: 14
Views: 29629

klumsy wrote:ok here are some snippets
Thanks for the code! Well, in Delphi the "Self" pointer is stored just as any other parameter, so there's no problem.
klumsy wrote:maybe another way we could do this
Hmmmmm... Might be possible, I'm not sure... I'm glad that things are so much easier in Delphi... :D
by madshi
Fri Aug 06, 2004 12:18 pm
Forum: madExcept
Topic: Custom exception handler not always called
Replies: 56
Views: 51250

Too bad, I don't like this solution...

But if it works for you, I'll probably have no other choice than to use it.
by madshi
Fri Aug 06, 2004 11:41 am
Forum: madExcept
Topic: Custom exception handler not always called
Replies: 56
Views: 51250

What happens if you change the second SendMessageTimeout call to SMTO_NORMAL, too?
by madshi
Fri Aug 06, 2004 10:51 am
Forum: madExcept
Topic: Custom exception handler not always called
Replies: 56
Views: 51250

Hmmm... When you stepped through the code, did you keep under the timeout value? Maybe SendMessageTimeout had already timed out? Otherwise it's almost impossible. When looking at the sources: If SendMessageTimeout results in ReceiveFireHandlers being called, there's no way (I can see) how the result...
by madshi
Fri Aug 06, 2004 10:14 am
Forum: madExcept
Topic: Custom exception handler not always called
Replies: 56
Views: 51250

It's getting stranger. But we're also getting nearer. It seems that the msg handling doesn't work correctly, but I can't explain why. If I could only reproduce it on my PC... :( Could you please copy madTools.pas to your project folder? You will also need "mad.inc" and you have to edit it....
by madshi
Fri Aug 06, 2004 9:27 am
Forum: madExcept
Topic: Custom exception handler not always called
Replies: 56
Views: 51250

Well, that's really strange! Could you please check whether SendMessageTimeout returns 0 or <>0? Also please check which value "FireHandlersWnd" has and what "IsWindow(FireHandlersWnd)" returns. Maybe someone closed that window?? Would be quite strange, though...
by madshi
Fri Aug 06, 2004 8:49 am
Forum: madExcept
Topic: Custom exception handler not always called
Replies: 56
Views: 51250

That's the "1500" value in the SendMessageTimeout call. You can raise that to any value you like. But as a result your program will pause all those seconds and do nothing. You can as a test increase that value to "30000" (30 seconds). Have you tried the latest beta? It *might* he...
by madshi
Fri Aug 06, 2004 8:12 am
Forum: madExcept
Topic: Custom exception handler not always called
Replies: 56
Views: 51250

I think we have 2 problems now: (1) You told madExcept that your exception handler must be called in the context of the main thread. As a result madExcept's work thread tries to contact your main thread by using SendMessageTimeout - but that fails. I don't know why it fails. I guess that someone (ma...
by madshi
Fri Aug 06, 2004 7:00 am
Forum: madExcept
Topic: Custom exception handler not always called
Replies: 56
Views: 51250

Perhaps this time we have a different situation. May very well be. Could you please post a bug report of this situation (when the madExcept box appears) together with a log file? Thank you!
by madshi
Fri Aug 06, 2004 6:58 am
Forum: madCodeHook
Topic: Hooking C++ member function
Replies: 14
Views: 29629

man i love dephi Me, too! on the delphi front hooking "@TSomeClass.SomeMethod" would hook every call that that method of every instance right? Yes. as for C++, i'm working on a framework now to do it, (we can already do it for static methods), but i'm using inline assembler to do the equi...
by madshi
Thu Aug 05, 2004 11:44 am
Forum: madExcept
Topic: Custom exception handler not always called
Replies: 56
Views: 51250

Okay, will change it. Thanks for your help in finding this problem!
by madshi
Thu Aug 05, 2004 11:31 am
Forum: madExcept
Topic: Custom exception handler not always called
Replies: 56
Views: 51250

Ok, then I'll change it to SMTO_NORMAL in my sources, too, and stay with 1500ms. You've only changed the first of the 2 SendMessageTimeout calls, right?
by madshi
Thu Aug 05, 2004 10:25 am
Forum: madExcept
Topic: Custom exception handler not always called
Replies: 56
Views: 51250

P.S: If that doesn't help you could also check what "c2" contains after each of the two SendMessageTimeout calls. It should be 777. Is it not?
by madshi
Thu Aug 05, 2004 10:25 am
Forum: madExcept
Topic: Custom exception handler not always called
Replies: 56
Views: 51250

We're getting near. madExcept calls SendMessageTimeout to synchronize your exception callback, and that fails. In this code: b2 := (SendMessageTimeout(FireHandlersWnd, FireHandlersMsg, 1, integer(@fhp), SMTO_ABORTIFHUNG, 1500, c2) <> 0) and (c2 = 777) and (SendMessageTimeout(FireHandlersWnd, FireHan...
by madshi
Thu Aug 05, 2004 7:49 am
Forum: madExcept
Topic: Custom exception handler not always called
Replies: 56
Views: 51250

Thanks, got it. Unfortunately I don't seem to be able to reproduce the problem on my pc... :cry: Could you please replace the following "if" statement in madExcept.pas and then create another log? Thanks! if (not fhp.handled) and (not frozen) and (FireHandlersWnd <> 0) and ( ContainsSyncHa...