TDAppTools: application add-on

Post your tools and samples or ask for them.
Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 2912
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

TDAppTools: application add-on

Post by Dave Rabelink » 27 Sep 2017, 13:11

TDAppTools
(current version v3.1, released on 10 july 2020)


Free application add-on offering handy features for developers, testers, designers and service engineers.
Features to increase productivity in working with applications created with Team Developer.
TDAppTools is available for all TD versions (32bit and 64bit), starting from TD 2.1.

TDAppTools is executed from within TD build applications offering a toolset giving detailed information on the application internals, even in production environments.

So to be clear, it is not a Team Developer IDE add-on which would primarily be used by developers in the TD development environment, but a toolset to be started
from your running application to get more information on that running application, wherever it is used.
Though it can also be used while debugging and running projects from source. TDAppTools has extra features enabled when running the application from the TD IDE.
(for instance locate GUI objects in source or break at the current source line when using Sql Monitor).


TDAppTools features

As TDAppTools is a personal project and mainly developed in spare free time it was not feasible to introduce all wanted tools at the start.
Those features should be compatible with most TD versions and offer generic functionality to be used in any project.


Gui Inspector

This tool is Spy++ with a TD flavor.

It is used like other GUI spy tools, but the Gui Inspector has the advantage that it shows specific TD information other generic spy tools do not offer.
With the well-known object selection tool, Gui objects can easily be identified on screen.
All information of the object is fetched in real-time and shows SAL details which will benefit anyone wanting to get more detailed information of the Gui internals.


List of features:
  • Easy select objects using drag and point principle
  • Show SAL object details like: class name, template name, SAL attributes and properties
  • Full qualification of objects to show parent/child relationship using template names
  • Shows in which process, dynalib (apd) or library (apl) the object is defined
  • View and change object values, titles/captions, fonts, colors, position and size in realtime
  • Drag objects around the screen to redesign a GUI
  • Inspect the window hierarchy using a tree view (for one process or all processes in the system)
  • Export data from tables, listboxes, comboboxes, listviews etc
  • View and change Windows Styles
  • View Windows properties
  • Class Browser: inspect the complete class hierarchy of an object
  • Locate process folder, show process details dialog, terminate process
  • Find objects based on window handle (Hex and Dec format)
  • Create screen-shots (to clipboard or to file)
  • Change the state and visibility of objects (enabled/disabled/hidden/visible)
  • Locate and select the object in the source-code when running from Team Developer IDE
  • Locate and select classes from the Class Browser in the source-code when running from Team Developer IDE
  • Print objects to IDE output window for easy select within TD
  • Search for Gui objects having a specific class name, template name, window handle, type or value/title
  • Monitor SAM, WIN and USR messages using DebugView.
  • v2.3: Send fixed or custom messages to any object
  • v2.3: Support for Window states (maximized, normal, minimized) and TopMost/NoTopMost
Screenshot:
Gui_Inspector_Overview1.png

Instead of creating a complete manual of Gui Inspector, a demo video has been created to demonstrate the features.
In the end of the video it is explained how to integrate it in your own projects.

You can find the video of Gui Inspector on the TDWiki YouTube Channel here:






Sql Monitor


Using Sql Monitor you can trace database actions performed by your application in real-time.
This is without having to enable logging (SQL.INI) or having to change the setup of your system in any way.

Just start the main trace window of Sql Monitor and it will detect when your application calls Sql functions.
These actions are displayed in the trace window and statement log.

Having "Break in source" feature you are able to break at the code line in the TD IDE where the SQL action is being executed.
For example, break on SqlfetchNext call in the source at the moment a record is fetched having specific data values or break
on SalPrepareAndExecute when a query is being processed.

List of features:
  • Detects calling of a set of predefined Sql functions from the current running application (eg SqlConnect, SqlPrepare, SqlFetchNext etc).
  • Works on any database brand (eg Oracle, SqlBase, DB2 etc) as long as the supported Sql functions are called from the application.
  • Enable and disable monitoring on-the-fly.
  • Shows the original sql statement executed.
  • Shows details on actions, like the parameter values of the sql function being called.
  • Inspecting result sets. Display the values of bind variables for each fetched record.
  • Exporting trace and result sets (records) to text, Excel (csv) and HTML.
  • Shows the actual time spent to execute the actions (measured on API level, so no extra noise of business logic etc).
  • Search for specific statements containing particular texts (like names for tables, columns, variables etc).
  • Search for specific records within result sets having a particular value for bind variables.
  • Pretty printed SQL statement using color coding.
  • Inspect fetched (string) buffers as-is or in HEX view. Also conversion options from UNICODE<->ANSI.
  • Break modes to halt execution when particular conditions are met. Application will wait.
  • Break in the sourcecode at the current DB execution action
  • Inspect sql statements, input bind variables BEFORE they are executed/send to the database (in breakmode).
  • Inspect output bind variables AFTER they are fetched from DB but before the application is about to process them (in breakmode).
  • Change the sql statement and/or input bind variable values BEFORE action is executed on database on-the-fly (in breakmode).
  • Change output bind variable values AFTER they are fetched from DB (in breakmode).
  • Change string (buffer) values by loading them from a file (in breakmode)
  • Save string (buffer) to file on disk.
  • New: support for ODBSal API functions OdrPrepareProc, OdrExecuteProc, OdrGetNextResults and OdrPrepareNextResults
  • New: support for SqlPrepareSP, SqlGetNextSPResultset, SqlCloseAllSPResultSets and SqlDropStoredCmd
  • New in 2.4: support for SqlConnectEx, SqlImmediate, SqlClearImmediate, SqlImmediateContext, SqlGetResultSetCount, SqlGetRollbackFlag, SqlGetModifiedRows, SqlOraPLSQLStringBindType, SqlStore, SqlRetrieve, SqlPLSQLCommand
  • New in 2.4: enable/disable single hooks to ignore certain traces or improve trace performance

Screenshot:
SqlMonitor_ResultsetViewer.png

You can find the video of Sql Monitor on the TDWiki YouTube Channel here:




Profiler Controller


With TD 7.2 a new feature is introduced: profiling

TDAppTools Profiler Controller is a simple screen having options to define and control the profiling.
You can easily start a profiling session at any moment.

List of features:
  • Only available for TD 7.2 and up
  • Define the trace file
  • Define the level (1 or 2)
  • Start, suspend, continue and stop profiling
  • View the trace file using the TD Profiling Viewer
  • View the trace file using the windows default application for the file extension
  • New in 2.4: TD 7.3 annotation feature added
TDAppTools_ProfilerController.png

You can find the video of TDAppTools V2.1 on the TDWiki YouTube Channel here:



You can find the video of TDAppTools V2.3 on the TDWiki YouTube Channel here:




How to implement


Implementation in your own project is easy.
To add Gui Inspector or Sql Monitor to the application is just adding one line of code.

Read the TDAppTools readme document for implementation and deployment instructions:
TDAppTools ReadMe




Here the YouTube TDAppTools playlist:
https://www.youtube.com/playlist?list=P ... wjQfwYxY5x

Info on TDAppTools and download link on TDWiki :
https://wiki.tdcommunity.net/index.php? ... TDAppTools
You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 2912
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: TDAppTools: application add-on

Post by Dave Rabelink » 12 Sep 2019, 10:55

TDAppTools v2.2 for TD 7.2 can now be found here:

https://samples.tdcommunity.net/index.p ... ools/v2.2/
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 2912
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: TDAppTools: application add-on

Post by Dave Rabelink » 30 Oct 2019, 10:04

New version released!

TDAppTools v2.3

Code: Select all

Version 2.3	30-10-2019

   # General
	- New: TD 7.2 version support
	- New: Added start screen or popup menu to open the several tools from one location (incl API)
	- New: About screen. Button for TD community forum
	- Change: Exports will use a unique filename using counters when file already present
	- Change: All tools saving GUI options is now enabled by default
	- Change: About screen. URL changed to https and tdcommunity. Direct donate link
   # Gui Inspector
	- New: Tool to send/post messages to objects. Pick messages from fixed list (SAM and WM) or use custom messages
	- New: Set objects TOPMOST/NOTOPMOST from the actions/z-order menu
	- New: Set state of window (maximized, normal, minimized) from new Window state menu
	- Change: TD themes screen, added Office 2016 theme (TD72 and up)
	- Change: Added missing CDK attribute strings up until TD72
	- Change: All Gui Inspector windows remember their screen locations
	- Change: Window tree view shows now all missing icon for known TD objects
	- Change: Now uses windows fontpicker instead of the Sal one to correctly preselect fonts
   # TD Profiling controller
	- Initial release. Only available for TD 7.2 and up

TDAppTools_SendMsgToObject.png

TDAppTools_MainStart.png

TDAppTools_ProfilerController.png


It can be downloaded here:
https://samples.tdcommunity.net/index.p ... DAppTools/


A video showing the new stuff:

You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Igor Ivanovic
Site Admin
Site Admin
Croatia
Posts: 1257
Joined: 05 Mar 2017, 12:37
Location: Zagreb, Croatia

Re: TDAppTools: application add-on

Post by Igor Ivanovic » 31 Oct 2019, 13:58

Dave,

As always thanks for your great work.
I found a little issue, the tdapptools.dll has still a version number 2.2 instead of 2.3, so my update isn't replacing the old dll with the new one.
Could you please correct it?

Thanks!
Igor Ivanovic
Image

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 2912
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: TDAppTools: application add-on

Post by Dave Rabelink » 31 Oct 2019, 15:34

Igor Ivanovic wrote:
31 Oct 2019, 13:58
the tdapptools.dll has still a version number 2.2 instead of 2.3, so my update isn't replacing the old dll with the new one.
Could you please correct it?
Ah, yes indeed.
I have updated the version number in the dll's.

You can download the new archive, the filename is now TDAppTools_v2.3r.zip

https://samples.tdcommunity.net/index.p ... ools/v2.3/


Thanks for pointing me to this.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 2912
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: TDAppTools: application add-on

Post by Dave Rabelink » 01 Nov 2019, 11:14

One known issue to mention about the Profiling Controller feature.

Due to some defects in the TD 7.2.0 profiling API, TDAppTools is unable to detect if a profiling session is currently suspended.
So if you suspend the profiling, close the Profiling Controller and later open it again, the GUI will not show that the profiling is suspended and you are then unfortunately unable to resume or stop.

I hope Gupta will resolve the issues in the next TD 7.2.1 update.

For now to workaround this issue: when suspending the profiling, keep the Profiling Controller window open while using the application so you can continue/stop the profiling later on.
(the controller window will keep the state locally without using the API to check the status)

The controller is however able to detect an active running session, so the GUI will show that correctly when opening the controller.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 2912
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: TDAppTools: application add-on

Post by Dave Rabelink » 31 Dec 2019, 11:30

New version released!

TDAppTools v2.4

Code: Select all

Version 2.4	31-12-2019

   # General
	- New: TD 7.3 version support
	- Changed: TDAppTools.dll is now TD version independant (build using VS2017)
   # Sql Monitor
	- New: support for SqlConnectEx, SqlImmediate, SqlClearImmediate, SqlImmediateContext, SqlGetResultSetCount, SqlGetRollbackFlag, SqlGetModifiedRows, SqlOraPLSQLStringBindType, SqlStore, SqlRetrieve, SqlPLSQLCommand
	- New: enable/disable single hooks to ignore certain traces or improve trace performance
	- Changed: significant performance improvements on hooking/unhooking to TD runtime
	- Changed: having SqlVarSetup bind values are now correctly evaluated
	- Changed: improved performance while tracing
	- Changed: edited SQL statements (break mode) will be used in tracing and bind evaluations
	- Changed: enable/disable trace and clearing history is now displayed as info in trace
   # TD Profiling controller
	- New: Annotate feature. Starting with TD 7.3

Remark:
The TDAppTools dll is now TD version independent. So it can be reused in all supported TD versions and is starting from TDAppTools v2.4 always as the same binary.
(the dll supports both ANSI and UNICODE TD versions).
Therefore the TD version number is not in the dll filename anymore.

The project is overhauled to make changes easier and to be able to release a new dll separately from the dynalib.
The version number of the dll will use it's own version scheme and starts with 3.0.0. When no changes are done on the dll a new TDAppTools release will keep releasing with the latest dll version.


Version 2.4 can be downloaded here:
https://samples.tdcommunity.net/index.p ... DAppTools/
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

monchotgu
Honduras
Posts: 70
Joined: 24 Apr 2017, 02:55
Location: Honduras

Re: TDAppTools: application add-on

Post by monchotgu » 05 Jan 2020, 20:11

Thanks Dave for an excellent tool. It helps A LOT!!


Ramon
Servicios Corporativos D.S.
Honduras,Central America

a_sivababu
India
Posts: 524
Joined: 10 Mar 2017, 08:46
Location: Chennai,India

Re: TDAppTools: application add-on

Post by a_sivababu » 12 Jan 2020, 10:23

Hi Dave,
I am currently integrating the TDAppTools with my application and trying to know how I can start/run the profiler or SqlMonitor or GUI inspector as soon as I start my application. I see the PAL functions to show the profiler or SqlMonitor or GUI inspector window but not seeing PAL functions to kick start the profiler or SqlMonitor or GUI inspector. I am manually starting the profile using profiler window after application opened but this does not capture the initial loading part of the coding/events etc.

So, Just wanted to know how to capture the traces which is fired during application startup and MDI window.

Thanks
Siva A

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 2912
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: TDAppTools: application add-on

Post by Dave Rabelink » 12 Jan 2020, 11:13

Hi Siva,

Yes. I understand your request and indeed the profiler can now only be used "after" the complete application startup has finished.
(the feature does not block execution of the application at the moment you call PALTDAppTools_ShowProfiler)

Sql Monitor when started performs tracing immediately, so if you put the PALTDAppTools_ShowSqlMonitor at SAM_AppStartup on the first line, you will get all SQL actions from that moment on.
Gui Inspector will only make sense when the GUI is completely finished initializing.

At this moment I'm busy with a new tool which will be added to TDAppTools which actually would make sense to have a "blocking" mode. Meaning that when called will stop the execution of the application so that you are able to use the tool right at the start of the application. The same would indeed make sense for the Profiler.
So the next version of TDAppTools, I will add the blocking feature to the Profiler also.

But as for profiling in general. Be aware that if you want to profile ALL actions, starting a profiling session on SAM_AppStartup is not enough. It is too late for some TD features.
All new class constructor functionalities are performed BEFORE the SAM_AppStartup. So when using the Profile API within the application you have to work-around this by starting the profiling in the first class in the outline having a constructor and start it there.

For now, to start profiling, place SalProfileStart at SAM_AppStartup or in one of your classes constructors. It will trace from there on.
Or pass the command line arguments --profilingLevel [1|2] –profilingFile <ouput file> to the application starting the profiling that way. Other option is to use the environment variables

Code: Select all

TD_PROFILING_LEVEL: 1 or 2 can be specified
TD_PROFILING_FILE: file name for the log

Then using the TDAppTools controller, you can pause/resume/stop it and start viewing the traces which was started earlier using any of the options described above.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

a_sivababu
India
Posts: 524
Joined: 10 Mar 2017, 08:46
Location: Chennai,India

Re: TDAppTools: application add-on

Post by a_sivababu » 13 Jan 2020, 03:39

Thanks a lot Dave for your immediate response.

you are right. The problem is only for TD Profiling and not for SqlMonitor and GUI inspector. I have realized this after posting my comments.

I was even thinking to add small dialog window for blocking mode and fires based on some intialization settings.

I did not know that all new class contructor fires starting even before SAM_AppStartup. Ok. I will check this as well.

Thank you once again for this tool and let me keep exploring TDAppTool since my performance of the application is getting slower and need to fine tune with the help of this diagnostic tool. I do not know whether it is due to so many control classes or some SQL statements or some coding sytles. I need to review and clean up the code to increase the performance.

Thanks
Siva A

Return to “Tools & Samples”

Who is online

Users browsing this forum: [Ccbot] and 0 guests