views:

355

answers:

2

I have upgraded my project from vb6 to VB.NET. The project is used to generate pdf files.. while upgrading I'm getting following problem.

Code:

'UPGRADE_ISSUE: Constant vbUnicode was not upgraded. Click for more:
'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2070"' 'taptisColor = IIf(mvarEncodeASCII85, ToASCII85(ImgColor), StrConv(System.Text.UnicodeEncoding.Unicode.GetString(ImgColor), vbUnicode)) sColor = IIf(mvarEncodeASCII85, ToASCII85(ImgColor),
DecodeString(System.Text.Encoding.UTF8.GetString(ImgColor))) 'sColor = IIf(mvarEncodeASCII85, ToASCII85(ImgColor),
StrConv(System.Text.UnicodeEncoding.Unicode.GetString(ImgColor), VbStrConv.None))

The problem is that it displays a black coloured rect where it should display the image as logo.

Please help. What to do to resolve unicode upgrade problem?

Thanks!

+2  A: 

This Microsoft forum thread could help solve the issue:

Upgrade VBA StrConv Byte Array vbUnicode ToString

Instead of StrConv, try to use the classes in the .NET namespace System.Text.Encoding.

splattne
+1. just beat me to it!
Mitch Wheat
It took me longer to reformat the question in order to make it readable to myself than to write the answer. ;-)
splattne
A: 

i hv used the following lines of code...

sPixel = IIf(mvarEncodeASCII85, ToASCII85(ImgBuf), DecodeString(System.Text.Encoding.Unicode.GetString(ImgBuf)))

it is still not showing the image...just displaying a black rect.. wat to do???