Visual Basic string is Unicode?
I am making a DLL in C++ so as to call it from VB.
In VB:
Private Declare Sub test Lib "../testdll.dll" (a as string, b as string) as long
In C++:
long __stdcall test(BSTR *a, BSTR *b) {
.......
.......
return 1;
}
When I test the DLL I find that the string passed to it, the variable who receives it is *a, is not a UNICODE string: if you check memory you find a simple ANSI array of characters.
For Example in VB a = "bob"
Shows in Memory:
42 = 'b'
6F = 'o'
62 = 'b'
00 = NULL
the ANSI of "bob", instead of the UNICODE representation:
42 = 'b'
00 = NULL
6F = 'o'
00 = NULL
62 = 'b'
00 = NULL
00 = NULL
00 = NULL
I would appreciate so much if someone can explain to me this issue.
After all, strings in VB are not UNICODE?
Thanks so much.
FededS

