The information in this article applies to:
SYMPTOMSA value of type L"String" passed as a BSTR value does not function correctly. CAUSEBSTR values are Unicode strings with a length prefix where the length is the number of bytes, excluding the terminating wide NULL. For example, the word "Hello" represented as a BSTR is the following: UINT(10) followed by UNICODE(Hello) - "\x0A\0\0\0H\0e\0l\0l\0o\0\0\0"If you use a plain L"String" value instead of a proper BSTR value, the BSTR length function SysStringLen() treats the value preceding the text (typically random values from the stack) as the byte count and uses half that value as the length. RESOLUTIONUse the SysAllocString() function to get a proper BSTR value. The allocated string must be released later by calling SysFreeString(). Please note that you should not add the length prefix because the format of the BSTR is subject to change. Following is some sample code that illustrates this solution:
REFERENCESMicrosoft Active Accessibility SDK Additional query words:
Keywords : kbAAcc |
Last Reviewed: January 10, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |