Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2010-09-09
5
Medium Priority
?
779 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 250 total points
ID: 33670223
try Convert.ToChar
0
 
LVL 1

Assisted Solution

by:supersugar
supersugar earned 250 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

Industry Leaders: 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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

824 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