M
mtay
I’m currently working on a VC++ 2005 dll used for encrypting and decrypting
passwords to be stored in an LDAP.
This dll needs to be called by a VB6 application, so I find myself limited
(I think) to using BSTR as the return value.
The encryption routine returns a char array which frequently contains null
characters. When I convert to a BSTR I’m losing all characters after the null.
I’ve tried SysAllocStringByteLen to control the length of the BSTR
(converting the char array to LPSTR beforehand) but the BSTR bears no
resemblance to the characters I started with.
I’ve also tried SysAllocStringLen, but I’m unable to convert to the right
data type without losing the characters after the null.
Can anyone suggest a way around this? I’ve thrown everything in my limited
knowledge at it.
If I changed my end component to VB.net, would this make a difference? Can I
use data types close to the VC++ ones?
passwords to be stored in an LDAP.
This dll needs to be called by a VB6 application, so I find myself limited
(I think) to using BSTR as the return value.
The encryption routine returns a char array which frequently contains null
characters. When I convert to a BSTR I’m losing all characters after the null.
I’ve tried SysAllocStringByteLen to control the length of the BSTR
(converting the char array to LPSTR beforehand) but the BSTR bears no
resemblance to the characters I started with.
I’ve also tried SysAllocStringLen, but I’m unable to convert to the right
data type without losing the characters after the null.
Can anyone suggest a way around this? I’ve thrown everything in my limited
knowledge at it.
If I changed my end component to VB.net, would this make a difference? Can I
use data types close to the VC++ ones?