// JP opened flex table

Click to See Complete Forum and Search --> : Nested structures in IDL


Tsahi Muyal
March 29th, 2000, 03:34 AM
Hi All,
I'm developing Client/Server application using vc6 and NT4(SP5).
I created an ATL COM object and the IDL file contain two structs:

typedef struct InnerStruct
{
long lParam1;
long lParam2;

}InnerStruct;

const long MAX_ST_SIZE = 6;

typedef struct OuterStruct
{

long lParam;
//InnerStruct tyInStb; //Remove "//" No bug
InnerStruct tyInSt[MAX_ST_SIZE]; //Bug

}OuterStruct;

The problem is in the client side, When the tlh is created (because of the import) the OuterStruct is declared before the InnerStruct and there is a compile error.
In case the OuterStruct doesn't have an array of structs but just a single struct the tlh compiled successfully.

TIA,
Tsahi Muyal

FunEx
April 5th, 2000, 11:36 AM
Try replacing MAX_ST_SIZE with the actual value, or use:
#define MAX_ST_SIZE 6
instead of the const value.

Tsahi Muyal
April 6th, 2000, 04:04 AM
Thank you very much for your response, But it didnt help.
I used all three options (const, #define or actual value ) but still in the tlh file the inner struct in declared after the outer struct.
Tsahi

//JP added flex table