Regarding ITextcontrol | developer.brewmp.com Regarding ITextcontrol | developer.brewmp.com

Developer

Regarding ITextcontrol

Forums:

Hi

I ' m encountering a strange problem regarding the use of ITEXT control in my application. When i 'm executing the application on device my application is failling to allocate memory resource. But when i 'm executing the same on brew simulator it is running fine

Quote:When i 'm executing the application on device my application is failling to allocate memory resource.
Not sure what you mean by this. Are you saying that ISHELL_CreateInstance is failing? What error code are you getting?

Quote:When i 'm executing the application on device my application is failling to allocate memory resource.
Not sure what you mean by this. Are you saying that ISHELL_CreateInstance is failing? What error code are you getting?

The step for ISHELL_CreateInstance() is working well but the next step while doing
ITEXTCTL_SetActive() it is failing.
Without using widgets I made some sample applications that worked fine on emulator but failed whenever I loaded them on device. Even for a simple hello world application which was running fine, I added a text control (ITextControl). Then tested on emulator which worked fine. But when loaded it on device it failed to run and the screen freezed for a while when I clicked my application Icon.

The step for ISHELL_CreateInstance() is working well but the next step while doing
ITEXTCTL_SetActive() it is failing.
Without using widgets I made some sample applications that worked fine on emulator but failed whenever I loaded them on device. Even for a simple hello world application which was running fine, I added a text control (ITextControl). Then tested on emulator which worked fine. But when loaded it on device it failed to run and the screen freezed for a while when I clicked my application Icon.

uvwx wrote:The step for ISHELL_CreateInstance() is working well but the next step while doing
ITEXTCTL_SetActive() it is failing.
Without using widgets I made some sample applications that worked fine on emulator but failed whenever I loaded them on device. Even for a simple hello world application which was running fine, I added a text control (ITextControl). Then tested on emulator which worked fine. But when loaded it on device it failed to run and the screen freezed for a while when I clicked my application Icon.
HI
Which device 're you using for testing your application on the device. Well, it is mentioned in Brew API Reference regarding ITEXTCTL
If an applet is compiled against a BREW version including and above 3.1.3, the newer text control will be picked up. The older behavior is now described by AEECLSID_TEXTCTL_10 if you wish to keep the older text control.
So try changing your AEECLSID for text control while its creation, if you 're using a handset having brew sdk version 3.1.x

uvwx wrote:The step for ISHELL_CreateInstance() is working well but the next step while doing
ITEXTCTL_SetActive() it is failing.
Without using widgets I made some sample applications that worked fine on emulator but failed whenever I loaded them on device. Even for a simple hello world application which was running fine, I added a text control (ITextControl). Then tested on emulator which worked fine. But when loaded it on device it failed to run and the screen freezed for a while when I clicked my application Icon.
HI
Which device 're you using for testing your application on the device. Well, it is mentioned in Brew API Reference regarding ITEXTCTL
If an applet is compiled against a BREW version including and above 3.1.3, the newer text control will be picked up. The older behavior is now described by AEECLSID_TEXTCTL_10 if you wish to keep the older text control.
So try changing your AEECLSID for text control while its creation, if you 're using a handset having brew sdk version 3.1.x

I am using MOTOROLA v3c and the BREW SDK on the phone is BREW(tm)3.1.2.50
The BREW version on which I have developed the application is BREW 3.1.5
Also to quote that,
ITEXTCTL_SetRect() is the line where it breaks in the following code:
void DisplayHello(myfirstapp *pMe)
{
AEERect *PRectApp = (AEERect *)MALLOC(sizeof(AEERect));
AEERect *PRectText = (AEERect *)MALLOC(sizeof(AEERect));
ISHELL_CreateInstance(pMe->pIShell, AEECLSID_TEXTCTL, (void **)&pMe->pTextAccountId);
PRectText->x = pMe->DeviceInfo.cxScreen -70;
PRectText->y = 10;
PRectText->dx = 60;
PRectText->dy = 5;
/*ITEXTCTL_SetRect(pMe->pTextAccountId, PRectText);
ITEXTCTL_SetCursorPos(pMe->pTextAccountId, TC_CURSOREND);
ITEXTCTL_SetInputMode(pMe->pTextAccountId, AEE_TM_NUMBERS);
ITEXTCTL_SetProperties(pMe->pTextAccountId, TP_FRAME);
ITEXTCTL_SetMaxSize(pMe->pTextAccountId, 10);*/
//AECHAR PAccId[] = {'1', '3', '6', '0', '8','\0'};
//ITEXTCTL_SetText(pMe->pTextAccountId, PAccId, WSTRLEN(PAccId));
SETAEERECT(PRectApp, 0, 0, pMe->DeviceInfo.cxScreen, pMe->DeviceInfo.cyScreen);
IDisplay_DrawRect(pMe->pIDisplay, PRectApp, MAKE_RGB(255, 255, 0), MAKE_RGB(0, 255, 0),IDF_RECT_FILL | IDF_RECT_FRAME);
AECHAR szText[] = {'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '\0'};
IDISPLAY_DrawText(pMe->pIDisplay, AEE_FONT_BOLD, szText, -1, pMe->DeviceInfo.cxScreen/2 - 10, pMe->DeviceInfo.cyScreen/2, NULL, IDF_TEXT_FORMAT_OEM | IDF_RECT_NONE | IDF_TEXT_TRANSPARENT);
//ITEXTCTL_Redraw(pMe->pTextAccountId);
//ITEXTCTL_SetActive(pMe->pTextAccountId, TRUE);
IDISPLAY_Update(pMe->pIDisplay);
FREEIF(PRectApp);
FREEIF(PRectText);
}

I am using MOTOROLA v3c and the BREW SDK on the phone is BREW(tm)3.1.2.50
The BREW version on which I have developed the application is BREW 3.1.5
Also to quote that,
ITEXTCTL_SetRect() is the line where it breaks in the following code:
void DisplayHello(myfirstapp *pMe)
{
AEERect *PRectApp = (AEERect *)MALLOC(sizeof(AEERect));
AEERect *PRectText = (AEERect *)MALLOC(sizeof(AEERect));
ISHELL_CreateInstance(pMe->pIShell, AEECLSID_TEXTCTL, (void **)&pMe->pTextAccountId);
PRectText->x = pMe->DeviceInfo.cxScreen -70;
PRectText->y = 10;
PRectText->dx = 60;
PRectText->dy = 5;
/*ITEXTCTL_SetRect(pMe->pTextAccountId, PRectText);
ITEXTCTL_SetCursorPos(pMe->pTextAccountId, TC_CURSOREND);
ITEXTCTL_SetInputMode(pMe->pTextAccountId, AEE_TM_NUMBERS);
ITEXTCTL_SetProperties(pMe->pTextAccountId, TP_FRAME);
ITEXTCTL_SetMaxSize(pMe->pTextAccountId, 10);*/
//AECHAR PAccId[] = {'1', '3', '6', '0', '8','\0'};
//ITEXTCTL_SetText(pMe->pTextAccountId, PAccId, WSTRLEN(PAccId));
SETAEERECT(PRectApp, 0, 0, pMe->DeviceInfo.cxScreen, pMe->DeviceInfo.cyScreen);
IDisplay_DrawRect(pMe->pIDisplay, PRectApp, MAKE_RGB(255, 255, 0), MAKE_RGB(0, 255, 0),IDF_RECT_FILL | IDF_RECT_FRAME);
AECHAR szText[] = {'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '\0'};
IDISPLAY_DrawText(pMe->pIDisplay, AEE_FONT_BOLD, szText, -1, pMe->DeviceInfo.cxScreen/2 - 10, pMe->DeviceInfo.cyScreen/2, NULL, IDF_TEXT_FORMAT_OEM | IDF_RECT_NONE | IDF_TEXT_TRANSPARENT);
//ITEXTCTL_Redraw(pMe->pTextAccountId);
//ITEXTCTL_SetActive(pMe->pTextAccountId, TRUE);
IDISPLAY_Update(pMe->pIDisplay);
FREEIF(PRectApp);
FREEIF(PRectText);
}

uvwx wrote:I am using MOTOROLA v3c and the BREW SDK on the phone is BREW(tm)3.1.2.50
The BREW version on which I have developed the application is BREW 3.1.5
Also to quote that,
ITEXTCTL_SetRect() is the line where it breaks in the following code:
void DisplayHello(myfirstapp *pMe)
{
AEERect *PRectApp = (AEERect *)MALLOC(sizeof(AEERect));
AEERect *PRectText = (AEERect *)MALLOC(sizeof(AEERect));
ISHELL_CreateInstance(pMe->pIShell, AEECLSID_TEXTCTL, (void **)&pMe->pTextAccountId);
PRectText->x = pMe->DeviceInfo.cxScreen -70;
PRectText->y = 10;
PRectText->dx = 60;
PRectText->dy = 5;
/*ITEXTCTL_SetRect(pMe->pTextAccountId, PRectText);
ITEXTCTL_SetCursorPos(pMe->pTextAccountId, TC_CURSOREND);
ITEXTCTL_SetInputMode(pMe->pTextAccountId, AEE_TM_NUMBERS);
ITEXTCTL_SetProperties(pMe->pTextAccountId, TP_FRAME);
ITEXTCTL_SetMaxSize(pMe->pTextAccountId, 10);*/
//AECHAR PAccId[] = {'1', '3', '6', '0', '8','\0'};
//ITEXTCTL_SetText(pMe->pTextAccountId, PAccId, WSTRLEN(PAccId));
SETAEERECT(PRectApp, 0, 0, pMe->DeviceInfo.cxScreen, pMe->DeviceInfo.cyScreen);
IDisplay_DrawRect(pMe->pIDisplay, PRectApp, MAKE_RGB(255, 255, 0), MAKE_RGB(0, 255, 0),IDF_RECT_FILL | IDF_RECT_FRAME);
AECHAR szText[] = {'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '\0'};
IDISPLAY_DrawText(pMe->pIDisplay, AEE_FONT_BOLD, szText, -1, pMe->DeviceInfo.cxScreen/2 - 10, pMe->DeviceInfo.cyScreen/2, NULL, IDF_TEXT_FORMAT_OEM | IDF_RECT_NONE | IDF_TEXT_TRANSPARENT);
//ITEXTCTL_Redraw(pMe->pTextAccountId);
//ITEXTCTL_SetActive(pMe->pTextAccountId, TRUE);
IDISPLAY_Update(pMe->pIDisplay);
FREEIF(PRectApp);
FREEIF(PRectText);
}
HI
On Moto V3C you have to change the Text Control's class ID to AEECLSID_TEXTCTL_10. Moreover There's no need to provide memory to AEERect rectangle that you 're creating for your control's display. Just use SETAEERECT function to set the dimension of the bounding rectangle for text control. More info on SETAEERECT can be retrieved through brew API Reference.

uvwx wrote:I am using MOTOROLA v3c and the BREW SDK on the phone is BREW(tm)3.1.2.50
The BREW version on which I have developed the application is BREW 3.1.5
Also to quote that,
ITEXTCTL_SetRect() is the line where it breaks in the following code:
void DisplayHello(myfirstapp *pMe)
{
AEERect *PRectApp = (AEERect *)MALLOC(sizeof(AEERect));
AEERect *PRectText = (AEERect *)MALLOC(sizeof(AEERect));
ISHELL_CreateInstance(pMe->pIShell, AEECLSID_TEXTCTL, (void **)&pMe->pTextAccountId);
PRectText->x = pMe->DeviceInfo.cxScreen -70;
PRectText->y = 10;
PRectText->dx = 60;
PRectText->dy = 5;
/*ITEXTCTL_SetRect(pMe->pTextAccountId, PRectText);
ITEXTCTL_SetCursorPos(pMe->pTextAccountId, TC_CURSOREND);
ITEXTCTL_SetInputMode(pMe->pTextAccountId, AEE_TM_NUMBERS);
ITEXTCTL_SetProperties(pMe->pTextAccountId, TP_FRAME);
ITEXTCTL_SetMaxSize(pMe->pTextAccountId, 10);*/
//AECHAR PAccId[] = {'1', '3', '6', '0', '8','\0'};
//ITEXTCTL_SetText(pMe->pTextAccountId, PAccId, WSTRLEN(PAccId));
SETAEERECT(PRectApp, 0, 0, pMe->DeviceInfo.cxScreen, pMe->DeviceInfo.cyScreen);
IDisplay_DrawRect(pMe->pIDisplay, PRectApp, MAKE_RGB(255, 255, 0), MAKE_RGB(0, 255, 0),IDF_RECT_FILL | IDF_RECT_FRAME);
AECHAR szText[] = {'H', 'e', 'l', 'l', 'o', ' ', 'W', 'o', 'r', 'l', 'd', '\0'};
IDISPLAY_DrawText(pMe->pIDisplay, AEE_FONT_BOLD, szText, -1, pMe->DeviceInfo.cxScreen/2 - 10, pMe->DeviceInfo.cyScreen/2, NULL, IDF_TEXT_FORMAT_OEM | IDF_RECT_NONE | IDF_TEXT_TRANSPARENT);
//ITEXTCTL_Redraw(pMe->pTextAccountId);
//ITEXTCTL_SetActive(pMe->pTextAccountId, TRUE);
IDISPLAY_Update(pMe->pIDisplay);
FREEIF(PRectApp);
FREEIF(PRectText);
}
HI
On Moto V3C you have to change the Text Control's class ID to AEECLSID_TEXTCTL_10. Moreover There's no need to provide memory to AEERect rectangle that you 're creating for your control's display. Just use SETAEERECT function to set the dimension of the bounding rectangle for text control. More info on SETAEERECT can be retrieved through brew API Reference.

hi , i have faced such probs , not sure , but try to use lower brew version ( like brew 213 "or" brew3.0 ), and then try with the device , i think it will work.
if u r using AEERect localy , no need to allocate it dynamically , u can allocate it statically

hi , i have faced such probs , not sure , but try to use lower brew version ( like brew 213 "or" brew3.0 ), and then try with the device , i think it will work.
if u r using AEERect localy , no need to allocate it dynamically , u can allocate it statically