Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Logging all method calls

Posted on 1998-06-11
2
Medium Priority
?
167 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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

688 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