Solved

Logging all method calls

Posted on 1998-06-11
2
158 Views
Last Modified: 2011-09-20
I have a friend that asked me this question and I could come up with only one solution, but I'd be interested in hearing what other possibilities are out there.

Q: Is there any way to "trap" and then log all method calls to all objects in an application?  We're talking several hundred classes and many, many methods.  Is there any way to hook into the Delphi object model and do this?

My suggested answer was to take all the base classes and add code to the methods to log the calls and parameters of each of the methods.  This is not a desirable solution, but at the moment it is the only one we could come up with.

I'm not aware of any single point to trap method calls, except possibly in COM or CORBA objects, which these are not.  Anyone have any thoughts or a solution?
0
Comment
Question by:descikartus
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
pjdb earned 100 total points
Comment Utility
Hook the OnMessage event of the Application to intercept every message send to every windows of the application. You can event put some filtering in this event toi log only some messages.
You can do the same for any form by defining a procedure asfollow
0
 
LVL 1

Expert Comment

by:pjdb
Comment Utility
One line is missing, something has gone wrong. It should be :

procedure OnWMSysCommand(var msg: Tmessage); message wm_syscommand;

0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now