Oops.  Here is the definitive word.  Thanks, Jim!

-bob mckenzie, palmsource pdx

-----Original Message-----
From: Jim Schram [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 06, 2002 1:23 AM
To: Palm Developer Forum
Subject: Re: Table problem (compiler error)


At 5:18 PM +0200 2002/02/05, Louis wrote:
>I am working with a table and have a table ptr declared as follows:
>  TableType* pT = FrmGetObjectPtr(Form,FrmGetObjectIndex(Form,TableId));
>if I want to get the number of columns, I do the following:
>  Int16 ColumnCount = pT->numColumns;
>but I get the following compiler error:
>  illegal use of incomplete struct/union/class 'struct TableType'
>Same for pT->items, etc...
>
>What does this mean?

That there's a problem in the way you access pT->numColumns and pT->items.
I'm going to guess you're using very recent SDK headers to build your code.
Look up the definition of TableType in Table.h and you'll probably see
something like this:

typedef struct TableType
#ifdef ALLOW_ACCESS_TO_INTERNALS_OF_TABLES   // These fields will not be
available in the next OS release!
{
   UInt16                  id;
   RectangleType           bounds;
   TableAttrType           attr;
   Int16                   numColumns;
   Int16                   numRows;
   Int16                   currentRow;
   Int16                   currentColumn;
   Int16                   topRow;
   TableColumnAttrType *   columnAttrs;
   TableRowAttrType *      rowAttrs;
   TableItemPtr            items;
   FieldType               currentField;
}
#endif
TableType;

The #ifdef/#endif pair removes the visibility of all structure members
unless you specifically #define ALLOW_ACCESS_TO_INTERNALS_OF_TABLES. The
compiler is saying the numColumns and items fields of TableType do not
exist... because they don't, unless you override the "default" typedef.

Regards,

Jim Schram
PalmSource Inc.
Partner Engineering

-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to