Structures

Structures are supported in the preferred form as well as the secondary form. . .

For example:

Preferred Form

typedef struct tagTestStruct {
long lCount;
float fPortion;
} TestStruct;
HRESULT SetWhatever([in] const TestStruct *pX);

Secondary Form

struct TestStruct {
long lCount;
float fPortion;
}
HRESULT SetWhatever([in] const struct TestStruct *pX);

Structures are presented as an object in the type tree. Access to member fields is only possible through the references to the object pool.

In the map rules, these reference values are indicated by a Ref. initiator and the reference number (nn) which follows the initiator. The COM Automation adapter uses that initiator to recognize the reference to the object pool and provides functionality for accessing the member fields using that reference.

The following text clarifies structure usage:

  • Nested structures (where one of the fields in a structure is in another structure) are supported, and those values are passed as a reference through the ref item.
  • The use of arrays as fields in the structure is permitted.

For example:

typedef struct {
long lLength;
float fSum;
} SimpleStructA;
typedef struct {
int iPencils;
int iPapers;
} SimpleStructB;
typedef struct {
int iAge;
SimpleStructA simpleStructA;