2.3.1 Including Server Version Numbers in Files

Server applications should include version numbers in any native data structures as well as in files. Newer versions of server applications that are intended to replace older versions should be capable of dealing with native data created by older versions. A version number in the structures allows:

A newer server application to convert the old data to a new structure

An older server application to notify the user that a newer version of the application is necessary to edit that data.

The following code example shows a data structure for storing the version number and related information.

typedef int VERSION;

typedef struct

{

VERSIONversion;

intidmColor;

intnwidth;

intnHeight;

intnX;

intnY;

intnHiMetricWidth;

intnHiMetricHeight;

charszName[10];

}NATIVE, FAR *LPNATIVE;

With OLE, a client application can embed an object created with one version of a server application and later request a newer version of that application to edit that same data.