forcing an instance method to take an ANSI string
The problem with Encoding.Ascii.GetString is the string it returns will still be a unicode string. foo.method(String) takes a string but the string must be an ANSI string. You can declare COM functions to be ANSI but only for static functions not instance methods such as foo.whateverMethod. The reason why I need to do this is that foo.method is actually a decryption method. It needs to decrypt legacy ANSI strings. I'm upgrading (dont' ask why) this app from vb6 to vb .NET. In vb6 ansi strings were ok. You could just use StrCnv(vbFromUnicode). This isn't an option in .NET. Here is the actual code from the VB6 app.
strCfr = StrConv(strCfr, vbFromUnicode)
status = TDciph321.DecryptString(strCfr, LenB(strCfr))
Thanks in advance for any help anyone could provide.
Ed