ISHELL_LoadResString() returns 0 | developer.brewmp.com ISHELL_LoadResString() returns 0 | developer.brewmp.com

Developer

ISHELL_LoadResString() returns 0

Forums:

I am a beginner to BREW.. I am trying to Load a resource from .bar file and the function ISHELL_LoadResString(pMe->pIShell, MYSECONDBREWAPP_RES_FILE, IDS_STRING_1001, szText, sizeof(szText)); returns 0.

This is what i did:
1. Created .brx
2. Created a New string in .brx.
3. Compiled .brx and generated .bar and .brh.
4. Used Macros MYSECONDBREWAPP_RES_FILE and IDS_STRING_1001 from resource files in my App.

But my LoadResString() returns 0. Same thing happened with Image.

I didnot understand what went wrong. I crossed it couple of times. But couldnot find any problem. I am using BREW 3.1.5.

what is the problem.?

Maybe something is wrong with the parameter szText.
Have you allocated memory for it?
Make sure the type of szText is AECHAR *.

Maybe something is wrong with the parameter szText.
Have you allocated memory for it?
Make sure the type of szText is AECHAR *.

Yes.. i made it as AECHAR szText[60]; and the string id has "Hello" in it..

Yes.. i made it as AECHAR szText[60]; and the string id has "Hello" in it..

Make sure you have the brh file in the same directory where dll is placed.

Make sure you have the brh file in the same directory where dll is placed.

Yes they are in same directory location..

Yes they are in same directory location..

ooh yaa.. i have changed all the resource files names to lower case .. and it started working.. i don't know why.. Thanks to everyone!!

ooh yaa.. i have changed all the resource files names to lower case .. and it started working.. i don't know why.. Thanks to everyone!!

Make sure u are making a correct call to the API specifying the size of the buffer as well.
If the size specified is less than the desired,it returns 0 .
So if ur string is "hello" ( 5 characters), the last parameter in the call to API should be atleast 6*sizeof(AECHAR).

Make sure u are making a correct call to the API specifying the size of the buffer as well.
If the size specified is less than the desired,it returns 0 .
So if ur string is "hello" ( 5 characters), the last parameter in the call to API should be atleast 6*sizeof(AECHAR).