Solved

Logging all method calls

Posted on 1998-06-11
2
166 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 1

Accepted Solution

by:
pjdb earned 100 total points
ID: 1352239
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
ID: 1352240
One line is missing, something has gone wrong. It should be :

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

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses
Course of the Month5 days, 10 hours left to enroll

627 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