Long Descriptor problem
| Mon, 2007-12-03 09:40 | |
|
i'm trying to parse xml in a string that i obtain from bluetooth rfcomm. but im having problems. i tried using HBufC8* iXmlString to receive it as follows, but there's a problem. Here is the code iParser->ParseBeginL(); any suggestions. |
|






Forum posts: 1232
HBufC8 is an 8 bit descriptor and TDesC is a 16 bit in default builds.
Try HBufC16 or TDesC8 (which depending on what you need)
Forum posts: 17
Thanks for your reply. I solved the problem using TDesC8&. I successfully passed the iXmlString into the CParse::ParseL() method as shown below
void CXmlHandler::RunL()
{
if ( KErrNone == iStatus.Int() )
{
// If the string length is zero, it means if we have reached
// the end of the string.
if ( iXmlString->Length() == 0)
{
iParser->ParseEndL();
delete iXmlString;
iXmlString = 0;
}
else
{
// Parse the XML document.
iParser->ParseL( *iXmlString );
SetActive();
}
}
else
{
iObserver.OnParseCompleted( iStatus.Int() );
}
}
When i run it i the applicaton hangs (nothing happens), am i missing something.
Forum posts: 159
Its hanging because you're not passing your active objects iStatus to anything as far as I can see.
Forum posts: 17
so what should i change so as to pass iStatus...im confused
Forum posts: 1232
You need to re-issue the request in RunL, its not enough to just set it as active again.
That is what Numpty is talking about.