Solved

Display UNICODE characters in Listview

Posted on 2010-11-30
6
2,344 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now