StringLoader::LoadLC() fails...
Hi,
I am using HTTP Post method to communicate with the server.
Following is the code snippet...
RHTTPResponse response = aTransaction.Response();
TInt status = response.StatusCode();
// retrive status text
TBuf<KMaxStatusTextLength> statusText;
statusText.Copy( resp.StatusText().DesC() );
// Load a string from the resource file and add status and status text
HBufC* textResource = StringLoader::LoadLC( R_HEADER_RECEIVED, statusText, status );
iObserver.ClientEvent( *textResource );
CleanupStack::PopAndDestroy( textResource );
Where R_HEADER_RECEIVED is "Header data received: %U %N"
My code fails at "StringLoader::LoadLC"... WHY?
Any type of help is appreciated.
Regards,
Mehul
Re: StringLoader::LoadLC() fails...
Does it show any error? so that v can find out something
Re: StringLoader::LoadLC() fails...
Load[COLOR="Red"]L[/COLOR]: You may consider TRAP-ing and checking the error code.
Re: StringLoader::LoadLC() fails...
Yes... I am getting STRINGLOADER 2 Panic on my simulator...
I have linked my project with "commonengine.lib" library..
also the resource string is present in .rsg file.
Hope this helps...
Regards,
Mehul
Re: StringLoader::LoadLC() fails...
I am getting "STRINGLOADER 2" Panic on my simulator.
Re: StringLoader::LoadLC() fails...
check whether string u r tring to load is available in resources or not.Also check the nos of parameter and type of parameters.
sometimes invalid parameters caused this err
Re: StringLoader::LoadLC() fails...
Invalid parameters always cause this arror
EKeyStringNotFound = 2 (The key string wasn't found in formatting.)
[url]http://www.forum.nokia.com/document/Cpp_Developers_Library/GUID-96C272CA-2BED-4352-AE7C-E692B193EC06/html/classStringLoader.html[/url]
I suggest you use something like CCoeEnv::AllocReadResourceAsDes16L() to read the string and see what it actually contains.