Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

Posted on 1999-01-29
3
232 Views
Last Modified: 2013-11-20
What is the maximum number of characters you can put on a BSTR?
0
Comment
Question by:lucent2000
  • 2
3 Comments
 
LVL 32

Expert Comment

by:jhance
ID: 1328511
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
 

Author Comment

by:lucent2000
ID: 1328512
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
 
LVL 32

Accepted Solution

by:
jhance earned 50 total points
ID: 1328513
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adapt this command to show who installed 29 111
no14 challenge 14 70
haveThree challenge 22 121
wordappend challenge 8 200
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question