Link to home
Start Free TrialLog in
Avatar of lucent2000
lucent2000

asked on

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?
Avatar of jhance
jhance

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...
Avatar of lucent2000

ASKER

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.



ASKER CERTIFIED SOLUTION
Avatar of jhance
jhance

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial