Unexpected font in CListCtrl?

117 views Asked by At

I have a CListCtrl object and I use:

AddData(m_listControl, 0, 0, "  Abc ");

This works fine in older version of Visual Studio (2008). However in Visual Studio 2013 I am using UNICODE character set, and the above displays a strange font in the List Control Box.

Can someone please tell me how to insert (AddData or another way) so that the CListCtrl displays english character set?

2

There are 2 answers

3
i486 On

Use TEXT( " Abc " ). TEXT() macro makes strings Unicode or ASCII depending on compiler settings.

0
JohnCz On

Well, why did you use this title:

"Unexpected font in CListCtrl?"

your problem has nothing to do with a font.

It also has nothing to do with list view control. It is AddData function that is giving you a hard time.

I am sure that in parameter list, the fourth argument is defined as const char*. You will have to change function’s signature. Try LPCTSTR as type. Than, follow i486's answer.