CompuServe Thread

#Help w/BSTR

5 messages in this thread
#114905From: Steven D. KapplinJul 29, 1990 2:11 PM
Betty, OK! I have been able to trace through what Jim Butterfield gave you, but I don't know what to do with BSTRs. I can locate all the addresses (I used ARTM to find out what they were, in advance, so I would know if I found the right things) with MemEd. I don't know how to convert a BSTR to anything intelligible. HELP! Steve
#114909From: John DraperJul 29, 1990 3:54 PM
Steven, A BSTR consists of a single length byte, followed by the contens of the string. -larry
#114920From: Steven D. KapplinJul 29, 1990 6:39 PM
Larry, Is the string in ASCII? In what I was doing I could find the location of the BSTR, but it wasn't readable as ASCII text. How would I convert the string to a readable form? Steve
#114949From: John DraperJul 29, 1990 10:33 PM
Steven, Yes, the string is in ASCII. As to finding it, you need to know what it is that points to the string. If it is a regular pointer, it will point to the length byte at the beginning (which of course is _not_ ASCII). If, however, it is a BPTR, you will need to multiply it by 4, since a BPTR is a pointer to relative longword, in order to get the BSTR's real address. -larry
#115038From: Steven D. KapplinJul 30, 1990 6:24 PM
Larry, Thanks. After your last message I got to thinking about what you said, then after looking at what I had, I realized that what I had was actually a pointer to the BSTR, rather than the string itself, which is what I first thought. I then found the string, and sure enough, it was in ASCII. Appreciate the help! Steve