[WASTE-list] WERegisterCustomAttribute

Marco Piovanelli marco.piovanelli at pobox.com
Wed Jun 14 11:24:25 EDT 2006


On Mon, 12 Jun 2006 14:36:32 -0400,
Alfred Van Hoek (vanhoek at mac.com) wrote:



>On Jun 8, 2006, at 2:00 PM, Marco Piovanelli wrote:

>

>> Are you sure the tagUserID changes between calls to

>> WERegisterCustomAttribute?

>

>

>That was indeed questionable ;-) But there is one other problem. When

>the DescType is set to 'bool' and the size is set to sizeof(Boolean),

>an exception is thrown based on the wrong size..

>

>What valid DesType and sizeof are allowed?


Currently, WASTE doesn't do anything with the attribute type
parameter, except storing it along with the attribute value if
the attribute is persistent. So any attribute type will work.

However, this may change in a future release, as the attribute
type may be used to perform automatic coercions or endian swaps,
so you should try to stick to standard types defined in
<AE/AEDataModel.h> (like typeBoolean, typeSInt32, typeUnicodeText,
etc.), if possible.

Unlike the attribute type, the attribute size *is* checked so
WASTE will return an error code (weInvalidAttributeSizeErr = -9471)
if you try to get or set a custom attribute with a size different
from the one you specified when registering the attribute.

The exception to this rule is when you pass a zero attribute
size to WERegisterCustomAttribute. Zero means "variable-size
attribute" and effectively disables size checks.

I'm not sure why you're getting errors with typeBoolean -- I've
tested this with the WASTE Demo and it works here. Could it
be (wild guess) that you're using sizeof(Boolean) in some
places and sizeof(bool) elsewhere?


-- marco

--
It's not the data universe only, it's human conversation.
They want to turn it into a one-way flow that they have entirely
monetized. I look at the collective human mind as a kind of
ecosystem. They want to clear cut it. They want to go into the
rainforest of human thought and mow the thing down.



More information about the WASTE-list mailing list