Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi friends:
Have u ever encountered this case: after calling the function

ITEXTCTL_SetText(pApp->m_pText, pApp->m_pInputWord, MAX_WORD_SIZE*sizeof(AECHAR)),

the content of pApp->m_pInputWord is cleared, in other words, it became a empty wide string. Note that pApp->m_pInputWord is a global variable declared in app structure. Does this case have something with pApp->m_pInputWord's attribute?

It is working for me..
the 3rd parameter is AECHAR length not size. It is the number of AECHAR characters to be assigned from the string to the text of the text control object.
pMe->m_piMychar = (AECHAR *)MALLOC(10*sizeof(AECHAR));
WSTRCPY(pMe->m_piMychar,L"Hello");
ITextCtl *pMyTextCtl=NULL;
AEERect rc={0};
nResult=ISHELL_CreateInstance(pMe->pIShell,AEECLSID_TEXTCTL,(void **)&pMyTextCtl);
BREAKIF(nResult);
rc.x=10;rc.y=20;rc.dx=50;rc.dy=50;
ITEXTCTL_SetText(pMyTextCtl,pMe->m_piMychar,10);
ITEXTCTL_SetRect(pMyTextCtl,&rc);
ITEXTCTL_SetActive(pMyTextCtl,TRUE);
RELEASEIF(pMyTextCtl);

It is working for me..
the 3rd parameter is AECHAR length not size. It is the number of AECHAR characters to be assigned from the string to the text of the text control object.
pMe->m_piMychar = (AECHAR *)MALLOC(10*sizeof(AECHAR));
WSTRCPY(pMe->m_piMychar,L"Hello");
ITextCtl *pMyTextCtl=NULL;
AEERect rc={0};
nResult=ISHELL_CreateInstance(pMe->pIShell,AEECLSID_TEXTCTL,(void **)&pMyTextCtl);
BREAKIF(nResult);
rc.x=10;rc.y=20;rc.dx=50;rc.dy=50;
ITEXTCTL_SetText(pMyTextCtl,pMe->m_piMychar,10);
ITEXTCTL_SetRect(pMyTextCtl,&rc);
ITEXTCTL_SetActive(pMyTextCtl,TRUE);
RELEASEIF(pMyTextCtl);