Solved

Display UNICODE characters in Listview

Posted on 2010-11-30
6
2,408 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
  • 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Dsum Function for List Box Data 7 45
Combobox row source 2 20
Access on Mouse move 5 34
Calculate Time acces 2010 12 29
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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…

777 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