ADUG Meeting July 1997
These notes by
Glenn Lawrence © 1997Announcements - Q&A Session - Presentation: "COM in Delphi" - Close
![]()
| Ilan Goldman (DCA) | |
| Tony Rietwyk (Park Lane Information Technology) | |
| John McDonald |
AGM:
News:
AIMTec's Property Vision system (written in Delphi) goes live at Stockdale and Leggo Mount Waverley.
As usual the Q&A session was substantial, but as I am writing this some time after the event I can't recall many details.
I remember that I asked about whether it was possible to find all components in a Delphi app at run time. At first it seems easy, you just traverse the owner-owned tree from the Application object, but the possibility of unowned components means this isn't guaranteed to find them all. Peter Szymiczek suggested you could walk the heap looking for them, but this doesn't guarantee that what you find is a real component. Eventually the consensus was that there really is no guaranteed way to find all components.
Graham Bashford asked about some problems he was having getting DLLs to work. The suggested solution was to start by getting the code to work first in a non-DLL environment and proceed from there.
Mark Weston is Principal Consultant of Real Solutions a small but growing software consultancy. Mark has been developing PC software for many years, initially in Visual Basic, but for the last few years in Delphi. Mark specializes in Cooperative Processing technology - especially Client/Server.
Marks presentation was based loosely around a paper entitled "What OLE Is Really About" written by Craig Brockschmidt of Microsoft Corporation. It is available at the Microsoft web site at http://www.microsoft.com/oledev/
Mark also suggests reading the Delphi 3 Developers guide chapters 36 to 42.
Mark demonstrated how to create a bare-bones COM object in Delphi and compared it with a "normal" DLL offering the same functionality.
Mark's source code that he used in his examples are available for download from the ADUG web site.
The following are some of the issues that I recall beingraised during Mark's talk.
| Similar idea to objects in Object Pascal and other OOP languages. Allows you to model real world objects. | |
| Can work across different platforms including Unix, Mac and mainframe. | |
| Reasonably simple to program, especially in Delphi 3, although not quite as easy as ActiveX or OLE servers. | |
| Some of the versioning problems have been overcome. With DLLs and VBXs different versions of the same object can be sprinkled around the file system causing apps to behave strangely. With COM there can be only one version. |
| COM objects use Class IDs that must be unique. To make sure you have a globally unique ID (GUID) you must apply to Microsoft or run a special utility that statistically guarantees that you get a unique key based on things like network card ID, date and time etcetera. Programmers must have self discipline to ensure that they use only kosher methods of getting an ID. | |
| A GUID is not very readable to humans so it is often mapped to a friendly synonym called a Prog ID. You have to be careful to choose Prog IDs that are unlikely to be the same as others on the same PC. | |
| Not all versioning problems are fully resolved. There is still the issue of providing backward compatibility and your COM object has to be coded to support all previous versions in some way. |
Mark's presentation was very well received and gave many of us our first introduction to the world of COM programming.
Many thanks Mark!
The meeting closed at around 8:30pm and the committee met immediately afterwards. Committee meeting minutes are available to ADUG members from the ADUG secretary.