problem with IStatic properties | developer.brewmp.com problem with IStatic properties | developer.brewmp.com

Developer

problem with IStatic properties

Forums:

Can anyone help me??
I tried to show text message using IStatic...if I put the text in left alignment, it turned out to be just fine...
but after I set the properties into ST_CENTERTEXT or ST_MIDDLETEXT, the text became chinese characters...

ISHELL_CreateInstance(pMe->pIShell, AEECLSID_STATIC, (void **)&pWriteText);
if(pWriteText)
{
ISTATIC_SetRect(pWriteText, &textRec);
ISTATIC_SetProperties(pWriteText, ST_ASCII);
ISTATIC_SetProperties(pWriteText, ST_CENTERTEXT);
ISTATIC_SetText(pWriteText, NULL, (AECHAR *)"This\ntext\nshould\nbe\ncentered", AEE_FONT_NORMAL, AEE_FONT_NORMAL);}
ISTATIC_SetActive(pWriteText, TRUE);
ISTATIC_Redraw(pWriteText);
ISTATIC_Release(pWriteText);
pWriteText = NULL;

can anyone tell me what's wrong with my code??

Try out this
ISTATIC_SetText (
pWriteText,
NULL,
L"This\ntext\nshould\nbe\ncentered", //instead of (AECHAR*)
AEE_FONT_NORMAL,
AEE_FONT_NORMAL
);
Regards,
Shashi Kant

Try out this
ISTATIC_SetText (
pWriteText,
NULL,
L"This\ntext\nshould\nbe\ncentered", //instead of (AECHAR*)
AEE_FONT_NORMAL,
AEE_FONT_NORMAL
);
Regards,
Shashi Kant

thank you for your reply...
I have tried it... I have removed the (AECHAR *) but it still results the same...
any other idea??

thank you for your reply...
I have tried it... I have removed the (AECHAR *) but it still results the same...
any other idea??

I guess you missed the all important prefix L before your string . See the code snippet properly. It should work.
Note:
As, ISTATIC_SetText takes AECHAR* ie unicode for text, you ought to prefix your strings with L
eg. L"Hello World"
Regards,
Shashi Kant

I guess you missed the all important prefix L before your string . See the code snippet properly. It should work.
Note:
As, ISTATIC_SetText takes AECHAR* ie unicode for text, you ought to prefix your strings with L
eg. L"Hello World"
Regards,
Shashi Kant

Oh. I see. It works.
Thank you very much.
Btw, what does that "L" mean??
I've never used it or heard of it before.

Oh. I see. It works.
Thank you very much.
Btw, what does that "L" mean??
I've never used it or heard of it before.

Indicates literal to the compiler

Indicates literal to the compiler