Solved

Display UNICODE characters in Listview

Posted on 2010-11-30
6
2,444 Views
Last Modified: 2012-05-10
I have a form in MS Access with a listview control.
Some values I need to display are in unicode, but the listview will not show the characters, just replaces them with question marks.

I've looked at other articles such as:
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_20252634.html?sfQueryTermInfo=1+10+30+listview+unicod
and tried using SendMessage as in attached code (I call the SendMessage function in form's module at time of populating Listview.)
The function returns 1 - suggesting the listview did receive the message, but still the characters are in ANSI, not unicode.
Listview class is MSComctlLib.ListViewCtrl.2 and Access is running on MS Office 2003/Windows Server 2003.

Any suggestions?
Public Declare Function SendMessage Lib "User32" _
         Alias "SendMessageA" _
         (ByVal hWnd As Long, _
         ByVal wMsg As Long, _
         ByVal wParam As Long, _
         lParam As Long) As Long

Public Const CCM_FIRST = &H2000&
Public Const CCM_SETUNICODEFORMAT = (CCM_FIRST + 5)
Public Const LVM_SETUNICODEFORMAT = CCM_SETUNICODEFORMAT
Public Const CCM_GETUNICODEFORMAT = (CCM_FIRST + 6)
Public Const LVM_GETUNICODEFORMAT = CCM_GETUNICODEFORMAT

Call SendMessage(ListView1.hWnd, LVM_SETUNICODEFORMAT, 1, ByVal CLng(0))

Open in new window

0
Comment
Question by:Billy_London
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 9

Expert Comment

by:Ramanhp
ID: 34238263
0
 
LVL 3

Author Comment

by:Billy_London
ID: 34238278
Hi
I've seen that article. It doesn't help. I can display the unicode string in a text box, but the listview activex control will not display unicode.
It's used to list file names; when user double-clicks, then it will launch that file. Once the listview receives the unicode string, it converts it to plain ANSI.
0
 
LVL 10

Expert Comment

by:borgunit
ID: 34239274
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:Billy_London
ID: 34239308
Hi
yes, I also saw that. It tends to contradict documentation on Microsoft's technet site; if it cannot display unicode, why would they document the LVM_SETUNICODEFORMAT parameter in the first place?
Even if it were true that I'm at a dead end with Microsoft's control, I'm a bit reluctant to roll out other ActiveX controls. The Access db is used on several different platforms (including 32 and 64 bit) and using non-standard controls can add another layer of administration - not withstanding any licensing issues as this is a business application.
thanks
0
 
LVL 3

Accepted Solution

by:
Billy_London earned 0 total points
ID: 34257262
following worked for me, as advised by Chinese colleague:

regional and langage setting => set the Language for non-Unicode programs to 'Chinese (PRC)'
0
 
LVL 3

Author Closing Comment

by:Billy_London
ID: 34289788
on Windows 7:
go to Control Panel - Region and Languages - Administrative tab - change system locale
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question