What is the maximum number of characters you can put on a BSTR?

What is the maximum number of characters you can put on a BSTR?
lucent2000Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
jhanceConnect With a Mentor Commented:
I'll have to disagree.  The 2G limit is NOT a BSTR limit but rather a Win32 limit. BSTR on another platform will not have this limit.
0
 
jhanceCommented:
BSTRs are double NULL terminated and can be of any length under Win32.  Some functions that take a BSTR, however, may not be so forgiving, however...
0
 
lucent2000Author Commented:
The correct answer is this:
Quote from Nathan

2 gig...  I would not count on that being available as physical memory and
swap space will have to  actually hold the data if it is to be in memory.  

Why?  BSTR is, by defintion a length prefixed array of data.  The length
field for Win32 is a 32-bit integer, so the largest size is 2^32.  But under
WinNT and Win95, you can only access 2 gig of addressable space (as a user
process, a kernel level process could get all 4 gig), so it is 2 gig that
could be potentially used.



0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.