An update to the book is here 🙂
There’s the updated book in PDF format (zip files are no longer attached but can be downloaded from the links below).
The code referenced in the book can be downloaded from the below links:
- IDE Help Helper
- OTA Template
- Package Viewer
Well I’ve never written a book before so this may not be War and Peace on the Open Tools API that everyone wants but I hope that it goes some way towards filling the gap in the documentation that has existed. I would, if I had time, like to cover all of the Open Tools API, especially the ToolsAPI.pas file but that is a massive undertaking which I don’t have the time to do unfortunately. Should I get a nice 9 to 5 job around the corner from where I live which would keep me in the life I’m accustom to, then I might have a go.
For me working with the Open Tools API started with Delphi 3 all those many moons ago. The Open Tools API started with Delphi 2 (first 32-bit version) which allowed you to programme the IDE however it used a very different interface mechanism than is now in use today and one that I cannot even remember. I got a little help back then from an excellent book by Ray Lischner called the Hidden Paths of Delphi 3 which I read from start to finish (and still have) and if I remember correctly, created all the example code contain there in. I still think that if you can find this book its worth reading. There are many aspects to the Open Tools API and this book generally only covers those aspect contained within the ToolsAPI.pas file. There are many other files in the Open Tools API (have a look at the
Source\ToolsAPI\ directory in you installation, these files allow you to do other things like create your own property inspectors, virtual filing systems, proxies and much more.
Why did I start to investigate the Open Tools API? Well initially it seemed an interesting thing to learn (back in the days when I have way too much time on my hands) but eventually there came a point when I needed to solve a problem that the IDE either didn’t do or didn’t do it properly. The first instance of this was with Delphi 5’s module/code explorer which would just lock up (the rest of the IDE functioned). So I wrote PascalDoc, a code browser and documentation tool. This has since been supersede by Browse and Doc It which does the browsing, the documentation but also helps with profiling code with instrumentation and creating DUnit projects and modules. Later on when I started to use DUnit more and wanted to automate the compiling and running of the tests before compiling the main project, I created the Integrated Testing Helper.
The contents of this book are mostly a collection of blogs I wrote over a number of years on the Delphi Open Tools API. I haven’t done much to the chapters other than correct spelling mistakes and grammar as the chapters describe a journey through a learning process which I hope the reader will appreciate.
The chapter numbers are different here than the original blogs as I’ve included all the incidental information on the Open Tools API which I think adds to this knowledge base. There are a number of mistakes in some of the articles which are identified and corrected in later chapters as they were in the original blogs. It is therefore suggested to read the whole of this book to ensure you know about any issues in the earlier articles.
The reason for the blogs originally was to write down all that I had found out while trying to implement Open Tools API code so that I had a reference as to why I had done things in a particular way but also to provide the same information to the wider Delphi community. I’ve also written a number of new chapters on topics that have been outstanding for several years.
Additionally, all the referenced code examples are contained in a number of ZIP files above on this web page. The example code is free for all to use as they see fit. The code for Browse and Doc It and the Integrated Testing Helper is provided for reference. The Open Tools API aspects of the code are also free to be used however I do reserve all writes to the remaining code which is provide for information purposes only and not for redistribution or reuse.
I haven’t done very much with Delphi and the Open Tools API in the past few years other than maintain some of my existing applications however I’m not down and out yet! Although I don’t know whether I’ll get time to do any more investigation into the Open Tools API I have in the back of my mind that I would update this book and publish the additional material for all. In trying to finish this book I skipped across an IOTA interface for the help system. One of the annoyances of the latest IDEs is their lack of MS Win32/64 SDK help so I might investigate whether I can intercept this F1 context key press and redirect them to a browser and bring up the MSDN reference. Like most of these things I have done, I have no idea whether I can do it but I’ll have a go and let you know.
Finally, I’m sure that there are going to be some spelling mistakes, grammatical errors as well as issues with the code so I would appreciate constructive feedback on the book, its contents, style, etc. and I will attempt to update the book at a future time. Also I would like to thank David Millington for encouraging me to get my head backing into the Open Tools API and writing this book.
Hope you all enjoy.
David Hoyle @ Sep 2016