![]() |
![]() ![]() |
|
What it takes to overcome Delphi's lack of multiple inheritance By Neil J. Rubenking The PC software development community is segregated by platform and programming language. I program with Delphi for Windows, you program in assembly language for DOS, and she programs in C++ for OS/2. Expertise developed on one platform doesn't necessarily apply to another, and skill in one programming language may actually hinder learning another. And interprocess communication, which has the potential to break down these barriers, is made difficult by differing internal representations of data. But there is one way to bridge the gap--with a language-independent, cross-platform standard for communication between objects: Microsoft's Component Object Model (COM). And COM is here now; it's the essential technology underlying OLE and ActiveX. Unfortunately, the current literature's COM programming examples don't demonstrate much language-independence. All but a very few use C++. Some examples are straight C++ code and take advantage of the language's multiple inheritance. Others are built on MFC and rely so heavily on COM-specific macros that the result isn't even recognizable as C code. The bottom line: If C++ isn't your development language, you're at a disadvantage when it comes to learning COM programming. In this column and a follow-up, we'll discuss the implementation of COM objects using Borland's Delphi development environment. This first part explains the problems involved in a Delphi COM implementation and demonstrates some solutions. The next article will show five specific COM objects--implementations of five standard Windows 95 shell extension types. Under some circumstances, COM objects can reside in .EXE files. But for the sake of simplicity, this article will deal with only the more commonly used COM objects that reside in DLLs. Published as Power Programming in the 01/07/97 issue of PC Magazine. |
|
TOP | ![]() Copyright (c) 1997 Ziff-Davis Inc. |