Access Trading System Manual For Computer Programmer's

  
Contents Index Previous Chapter Next Chapter

Extention Modelling


To Top Core Files

The core files and classes are:
ets, doc, mainfrm, childfrm - CETSApp, CPersistDoc, CMainFrame, CChildFrame
There is also and important Tools.DLL which contains a number of utility classes
Note that CMainFrame is derived from the Tools.DLL class CMDIRememberFrame
The purpose of that class is to save in the HKEY_CURRENTISER registry the size and status of the Main Frame Window
The view files are named view*



To Top Extention Modelling

The distinctive feature of Energy Trading System (ETS) Is Extention Modelling (EM)
The basis of Extention Modelling is as follows:

The Microsoft Foundation Classes Single Document Interface provides one document and one view.
You can change the view in context but you can only see one view at a time.
Close the Context View and you can close the document
The MFC Multiple Document Interface provides multiple views but as its name implies tends to supply a new document per view.
A point that is often overlooked or not understood. Close the last view and you close the last document.

To achieve Extention Modelling cetain MFC virtual functions have to be overridden
The view creation has to handled via the Child Frame
Since we use Objective Grid To Create Tabbed Views we have two styles of view creation

Considerable care was needed at this point with regard to translating a vanilla view to a tabbed view.
To support document aware dialogs requires the Application to create the document on the heap and allow the Main Frame Window easy access to the document. Finally, the dialog needs a method to Register An Interest In Updates from the document Callback member
[void CPersistDoc::HandleUserMessage( const CObjectUpdate* pUpdate )]

#ifndef CONNECTIONCALLBACK_H
#define CONNECTIONCALLBACK_H

class CObjectUpdate;

//
// class CConnectionCallback
// A callback interface for CRetrieve to use
//

class CConnectionCallback
{
public:
virtual void HandleUpdate( const CObjectUpdate* update ) = 0;
};

#endif // CCONNECTIONCALLBACK_H

Clearing the views also requires caution as MFC requires a Main Document Template (any one would do, we picked Trades) which MFC Auto Deletes.
Notice that CPersistDoc has no MESSAGE_MAP() entries. Nor should it have any static members as by definition the one and only instance of the class is always available.
With one document, one server connection there can only be one instance of the application per client machine.


Contents Index Previous Chapter Next Chapter To Top


Wilmott Online Technical Forum For Derivative Experts