In article news:[EMAIL PROTECTED], Pedro wrote:
Hi,
I have the following function to register objects in IAS database.
[re-ordered]
But, the query result is IAS_ATTRIB_UNDEFINED or UNKNOWN instead of
IAS_ATTRIB_USER_STRING. Why???? Please, help me.
Well the first thing to fix is this. From the IrIAS_Add Function
section in the reference PDF:
" The object is not copied, so the memory for the object must exist
for
as long as the object is in the database. [...]"
Declare each of your objects globally, or in dynamically allocated
memory, and that includes helloString too, because of the way you've
defined it, char[] as opposed to char*.
static void RegisterIASObject()
{
IrIasObject obj;
IrIasAttribute attr;
UInt8 helloString[] = { IAS_ATTRIB_USER_STRING, IR_CHAR_ASCII, 11,
'H','e','l','l','o',' ','W','o','r','l','d' };
attr.name = (UInt8 *)"Mensagem";
attr.len = StrLen("Mensagem");
attr.value = (UInt8 *)helloString;
attr.valLen = sizeof(helloString);
obj.name = (UInt8 *)"Server";
obj.len = StrLen("Server");
obj.nAttribs = 1;
obj.attribs = &attr;
IrIAS_Add(irref, &obj);
}
--
Alan J. McFarlane
http://www.alanjmcf.me.uk/
Please follow-up in the newsgroup for the benefit of all.
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/