The Building Blocks of a Cockpit Application

Top  Previous  Next

The finished application viewpoint

For an application Cockpit is a collection of dlls that must be distributed with it. Which dlls are required can be derived from the dll import libraries that were linked with the application. These dlls provide Cockpit adapter functions, Cockpit helper functions, Cockpit fake objects, Cockpit structure classes and Cockpit interface classes. These dlls rely on the dlls provided by Microsoft with the O/S or other vendors, e.g. Novell.

What you get

A Cockpit library package always comes with the dlls used at runtime, the import libraries (.lib files) to link with your application and the necessary header files which contain the constants you can use in your applications. The full source is always provided and it's up to you if you install it or not. It can be helpful to install it because you can take a look at the parameter adaptions, structure definitions, debugging and whatever else makes a programmers life worthwhile.

The Cockpit Shell Library

The Cockpit Shell Library CCKPTSHL.DLL brings the adapter functions, structures and interfaces for using the Windows Shell.

 

It relies on the Cockpit COM Library, the Platform Libraries and the Core Library.

 

If you want to auto-link the Cockpit Shell Library to your application, #include the file "CockpitShellLibs.ch" in one of your prg files. This will also auto-link the COM, Platform and Core Library.

Cockpit Extension Libraries

Cockpit Extension Libraries should rely on the Core Library and the Shared Platform Library CCKPTSHD only. It's not a problem if you use functions from the other Platform Libraries but you should keep in mind that this will add a lot of "dead" code to an application that otherwise does not need any user interaction or if you choose to stick with Xbase Parts.

 

So far I've packed together functions that are treated as a system in the MSDN documentation into one Cockpit Extension Library. Examples for such subsystems are Windows-Sockets, WNet or RAS.

 

Please note that you are not restricted to Windows functions when creating such Cockpit Extension Libraries. Collections of wrapper functions for the Novell API or R&R would make up nice Cockpit Extension Libraries.

 

The names of Cockpit Extension Libraries should start with "CPX".