|
-
Aug 6th, 2003, 01:02 PM
#1
Thread Starter
New Member
ANSI strings in VB .NET
The problem is I have an instance of an object from a COM that has a method that takes a string ByRef. The actual string that gets passed in gets manipulated by the method. The code worked fine in vb6 when string conversion to different formats were available using vbFromUnicode and vbUnicode. .NET only allows unicode strings. You can convert a string to ansi but what you get back is a byte array not a string. The method only accepts strings. DllImport and Declaring the function as ansi doesn't work because this is an instance method not a static method. Does anyone know a work around for this? I really need to pass an ansi string into this method but all i can pass is a unicode sting.
ex:
Dim foo as someComObject
foo.method(myString) ' unicode when it should be ansi
Thanks in advance.
Ed
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|