Solved

Display UNICODE characters in Listview

Posted on 2010-11-30
6
2,494 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

635 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