TDAppTools

From Team Developer SqlWindows Wiki
Revision as of 21:37, 16 February 2020 by DaveRabelink (Talk | contribs)

Jump to: navigation, search

TDAppTools


Contents


Pointer2.png TDAppTools add-on general info Pointer.png


Application add-on offering handy features for developers, testers, designers and service engineers.
Features to increase productivity in working with applications build with Team Developer.
TDAppTools is available for all TD versions, starting from TD 2.1 up to TD 7.3.


Introduction


During development, testing and maintenance of any TD build application, technical details about
the application internals is highly needed.
Developers, for instance, use Team Developer IDE debugging features to inspect the inner workings while creating
applications. By adding debug code, like tracing information to files, extra custom information about what
is going on in the application can be put to use to quickly spot errors or detect faulty data.
Placing messageboxes temporarily can show internal control data at specific points when executing a workflow.


Testers could need ways to extract data which is populated in GUI objects to validate if the data is correct.
Also reading the error logs or inspect trace info are very helpful to ensure the application is not encountering errors
which are not clearly visible for the end-user.


Service engineers who are on site at a production environment could encounter issues which should be reported back.
With more detailed information about the current state of the application and the system which it is running on, development teams
can work more efficiently to find and eventually fix defects.


To enable this, the developer has to add custom code to access these internals throughout the code.
And every project needs it, some way or the other.


Personally, as developer, I created many debugging features within my projects and copied handy custom tools and code from project
to project. In the end all those work was spread around projects and implementing them in new projects takes time to tailor them
to fit into those projects. This gave me the idea to implement a ready-to-go toolset which can easily be added to any application.
This toolset should be not included as source-code within projects. Including large amounts of code would enlarge the size of the project
and could potentially interfere with existing code and have an effect on the inner workings of applications.


So, TDAppTools add-on is meant to be packaged features in physical separated files which would not harm existing code.
The only elements added to project source-code is calling the needed interface of the add-on to start specific features.


TDAppTools available features


As TDAppTools is a personal project and mainly developed in spare free time it is 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.


Therefore I chose to introduce features one at a time for each major release.


The first tool in TDAppTools v1.0 will be the Gui Inspector, which is a very valuable addition to any project.
The second mayor release, TDAppTools v2.0 contains Sql Monitor, a tool to inspect Sql actions performed by your application in real-time. Version 2.3 adds the Profiler Controller to start/stop profiling which is introduced in TD 7.2.
Version 2.4 has improved performance for Sql Monitor and supports more Sql functions.

Later on, other features will be added in subsequent versions.


Pointer2.png TDAppTools version history Pointer.png

Version history for TDAppTools
------------------------------

Current version: 3.0


Version 3.0	16-02-2020	Dave Rabelink

   # General
	- Changed: TDAppTools.dll: new version to support App Info features
   # App Info
	- New: Initial release having: general info, loaded dll’s, PATH and environment settings, opened handles, running threads, SAL system variables and a WMI query tool
   # TD Profiling controller
	- Changed: Block application option added when starting profiling tool
   # Gui Inspector
	- Fixed: After changing windows styles of objects, they are now repainted correctly

Version 2.4	28-12-2019	Dave Rabelink

   # 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

Version 2.3	30-10-2019	Dave Rabelink

   # 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

Version 2.2	13-01-2017

   # General
	- New: About screen. Buttons linked to YouTube, TDWiki and TD Samples
	- Fixed: check runtime dll function now reloads dll when not found using full path
   # Sql Monitor
	- New: support for ODBSal API functions OdrPrepareProc, OdrExecuteProc, OdrGetNextResults and OdrPrepareNextResults
	- New: support for SqlPrepareSP, SqlGetNextSPResultset, SqlCloseAllSPResultSets and SqlDropStoredCmd
	- New: options screen, About button
	- Change: API attached functions list is now sorted
	- Change: number values are now shown using the actual decimals (eg 1,05 or 234,32345 or 2)
   # Gui Inspector
	- New: options screen, About button
	- New: options screen, checkbox to enable/disable DWM feature for better bounding rectange display
	- Change: column values in attributes and properties window can be selected (read only) (for copy to clipboard)
	- Fixed: SAL attribute screen repopulate issue when mode Keep bounds was enabled
	- Fixed: Now using DWM instead of GetWindowRect to paint bound rectangle top level objects (when API is present)
	- Fixed: TD51-TD63 -> TabPage and NavBarPage template names are now correcty determined (TD70 and up is ok)

Version 2.1	17-10-2016

   # General
	- Now fully compatible with TD 7.0 (x86)

   # Gui Inspector
	- New: Monitor messages (experimental)
        - Minor fixes
   # Sql Monitor
        - New: Break in source
        - Changed: attaching to API is now faster and more stable


Version 2.0	23-09-2016

   # Gui Inspector
	- New: TD Themes selector. Change TD theme on the fly.
        - Changed: Item name (qualified display) will show > for owner and . for parent relationships
        - Changed: Text export will open registered application for txt files (it was always using notepad)
        - Changed: HTML export will escape newlines now
   # Sql Monitor
        - New: Initial version introducing Sql Monitor


Version 1.0	25-06-2015
   # Initial version introducing Gui Inspector


Pointer2.png TDAppTools Gui Inspector Pointer.png


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:


  • Available for all TD versions, starting from TD 2.1
  • 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 or titles/captions
  • View and change object position and sizes in real-time
  • Drag objects around the screen to redesign a GUI
  • View and change fonts of objects
  • View and change object background and text colors
  • 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
  • v2.1: Message monitor to inspect SAM/VT/WM and USR messages on TD objects (experimental)
  • v2.3: Send fixed or custom messages to any object
  • v2.3: Support for Window states (maximized, normal, minimized) and TopMost/NoTopMost


Gui Inspector Overview1.png


Instead of creating a complete manual of Gui Inspector, demo videos have been created to demonstrate the features and how to integrate it in your own projects.


You can find the videos on the TDWiki YouTube Channel, playlist TDAppTools here:

Video.png TDAppTools PlayList


Video.png TDAppTools - Gui Inspector Demo


TDAppTools can be downloaded from TD Sample Vault here:


Web.png TDAppTools

For questions, ideas and issues please contact me at:

Email : Dave Rabelink


TDAppTools is a personal project, developed in free spare time.
So, if you like the tools, please consider a donation to support this development.
You can find the DONATE button here on the TDWiki in the toolbar at the left.


Pointer2.png TDAppTools Sql Monitor Pointer.png


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.


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 spend to execute the actions (measured on API level, so no extra noice 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.
  • 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.
  • v2.1: Break in source, to break at the source code line where SQL action is executed.
  • v2.4: Added support for more Sql functions. Improved hooking and evaluation performance. Enable/disable specific Sql function hooks


SqlMonitor ResultsetViewer.png


You can find the video on the TDWiki YouTube Channel here:


Video.png TDAppTools - Sql Monitor Demo


TDAppTools can be downloaded from TD Sample Vault here:


Web.png TDAppTools

For questions, ideas and issues please contact me at:

Email : Dave Rabelink


TDAppTools is a personal project, developed in free spare time.
So, if you like the tools, please consider a donation to support this development.
You can find the DONATE button here on the TDWiki in the toolbar at the left.


Pointer2.png TDAppTools Profiler Controller Pointer.png


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
  • v2.4: Added annotation feature (TD7.3 and up)


TDAppTools ProfilerController.png


Pointer2.png TDAppTools App Info Pointer.png


The purpose of this feature is to inspect more general information about the application and the environment.
Settings within the TD runtime but also general process and Windows info can be viewed and in some cases be changed at runtime.
App Info consists of several GUI tab pages for each of the groups of information.


TDAppTools AppInfo General.png


TDAppTools AppInfo WMIQuery.png


Below follows a brief introduction and their use cases.


General info

  • Show the filename and location of the running application
  • Displays version information of the executable (when available)
  • Display executable and runtime icon
  • The TD runtime version used and the folder location of the runtime
  • Which process and which user started the application (parent process)
  • The start time and running time
  • DEP policy settings
  • The current directory. This can be changed in real-time to force incorrect use of current folder functionality in the application


Environment

  • Lists all current system environment variables and their values
  • Edit, add and delete variables in real-time. These are immediately changed and used by the application


Paths

  • Lists all defined folder paths of the PATH environment variable
  • Move items up and down in the PATH list
  • Edit, add and delete PATH folders
  • Open folders in the list in Explorer


DLLs

  • Lists all currently loaded DLL's by the application.
  • Shows version information and other defined details like Description or Company name
  • Select file in Explorer or show the file details
  • Google search file to get more online info on the file


Handles

  • Lists all opened handles within the application. Type are shown like opened files or registry keys
  • Shows the currently loaded dynalibs
  • Force closing of handles (dangerous!)
  • Open the registry location in Registry Editor


TD system variables

  • List all available system variables like Sql variables and booleans like bStaticsAsWindows etc.
  • Edit system variables
  • Shows all command line arguments of the running application
  • Edit, add and delete command line arguments on the fly


Threads

  • List all currently running threads within the application
  • Shows state and creation time of the threads
  • Shows thread ID and which module (exe, dll) created the thread
  • Display the thread description (only Windows 10)
  • Edit the thread description
  • Suspend, resume and terminate threads


WMI query

  • Simple WMI query tool (supports only the current machine, not remote)
  • Namespace can be altered
  • Display the result as HTML table
  • Option to show result in MOF format
  • Get a list of Win32 WMI classes to be used in queries
  • Win32 class: preselect the SELECT * query for instances or to query the meta data (class attributes)


For all App Info features, the info can be exported to csv, text and html.
Also extra TDAppTools API function to generate the information without opening the App Info GUI.
This data can be saved to file or used as string within the application to be used in custom logging.


Extra TDAppTools API to execute WMI queries without opening the App Info GUI. The results can be saved to file
or can be used as string for custom logging or display.


App Info GUI can be started in blocking mode. Use this for instance in application startup to display and change settings.
Only when the App Info GUI is closed, the applications will continue execution.