Plain Vanilla or Cup Royal

Top  Previous  Next

There are three fundamentally different choices for the use of Cockpit.

1. You want to write your own dll function wrappers and intend to use only a minimum of Cockpit's functionality

Then all you need is the Cockpit Core. You can use callbacks, structures and all Core functions to implement your wrappers or use them during your calls. (You may also use the COM support classes provided by the Core.)

2. You want to use the O/S functions the Cockpit Libraries already provide

In this case you won't have to bother with the definition of structures, the programming of wrapper functions and COM interface wrappers or the collection of the necessary constants contained in the SDK's header files. Everything comes ready to use in your applications. All you have to do is choose the Cockpit Library Package you need and include the libraries and header files in your project.

 

You should, of course, have access to the MSDN documentation to find out about the functions and their parameters. If you want to know, if a function is available through a Cockpit Library, take a look at the library's function description list files which can be found in the "src" directories of the library packages. The names of these files normally start with "funclist_" or "winfunclist_". The next name component is the dll name who's functions are adapted. The extension is always ".ch". For example the function description list of user32.dll can be found in the Platform Library in the file winfunclist_user32.ch. The windows shell functions from shell32.dll can be found in the Shell Library Package in the file winfunclist_shell32.ch.

 

The function descriptions you find in the function description lists also contain all necessary parameter information Each parameter is specified in the function description with its "adaption". This adaption tells you which Xbase++ parameter is expected. Parameter adaptions are explained in detail in the Cockpit Synthesizer Reference.

 

Cockpit also provides adapter classes for COM interfaces. If you need to find out, if the adapter class you need already exists, look for a file name starting with "interfaces_" that continues with the name of the .h-file containing the interface description you're looking for. The extension of these COM interface adapter class modules is ".prg". Then check inside those files if the interface you need can be found. Just as with the adapter functions you can learn about the parameter adaptions of the interface's methods here as well.

 

If you go down this road, you should consider not using Xbase++ parts. The Xbase++ GUI architecture isn't exactly what the Windows developers had in mind. With Xbase++ 1.90 the Xbase++ GUI is run in two threads and uses three message queues. "Real" Windows applications are supposed to have exactly one GUI thread using one message queue. Cockpit provides adapter objects for all native Windows controls and almost all "common controls".

3. You want to create your own adapter functions or a Cockpit Extension Library

To do that, you need the Cockpit Synthesizer package which contains the tools instructing the Xbase++ preprocessor to create the Xbase++ adaption code from your own dll function or interface descriptions. Of course you can also create the necessary structures and create your own ".ch" files with the required constants from the ".h" files. With the Synthesizer Package you won't only be able to create your own adapter functions or interface adapter classes, you will also be able to add your own Parameter Adaption Definitions.