Solved

Difference between ChrW in VB6 and ChrW in vb.net 2005?

Posted on 2010-09-09
5
761 Views
Last Modified: 2013-12-26
Hi

I have a problem with ChrW i vb.Net 2005. It seems that the ChrW behaves differently in vb.Net than in vb6.

In vb.Net I have a toolbox control (in this case called AxWillettPrinter1), to which I pass some unicode characters, with the help of ChrW command:
AxWillettPrinter1.FeedBufferMultiLingual(e.name.ToString, ChrW(&H660) & ChrW(&H661) & ChrW(&H662) & ChrW(&H663) & ChrW(&H664) & ChrW(&H665))

I do exactly the same in vb6 (here the toolbox control is called BP):
BP.FeedBufferMultiLingual("Buffer1", ChrW(&H660) & ChrW(&H661) & ChrW(&H662) & ChrW(&H663) & ChrW(&H664) & ChrW(&H665))

The funny thing is that vb6 do exactly as expected, but in vb.net I only see what appears to be an empty string.

Could anyone clarify this for me?

TIA
0
Comment
Question by:Vernager
  • 2
  • 2
5 Comments
 
LVL 1

Expert Comment

by:supersugar
ID: 33634463
It should be same.

try replace your text with something else.

AxWillettPrinter1.FeedBufferMultiLingual(e.name.ToString,"ABCDEF")
I believe empty string appears as well..
0
 

Author Comment

by:Vernager
ID: 33634871
Hi

I have now tried to put in
AxWillettPrinter1.FeedBufferMultiLingual(e.name.ToString,"ABCDEF")

and it comes out just fine.
0
 
LVL 28

Accepted Solution

by:
Ark earned 125 total points
ID: 33670223
try Convert.ToChar
0
 
LVL 1

Assisted Solution

by:supersugar
supersugar earned 125 total points
ID: 33679572
Could it be the component you use doesn't support unicode?
try to put in chinese/japanese charater if it show correctly.
0
 

Author Closing Comment

by:Vernager
ID: 34715892
The problem was at a different place. You could say that the component did not support unicode.
0

Featured Post

Independent Software Vendors: 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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

685 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