Solved

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

Posted on 1999-01-29
3
234 Views
Last Modified: 2013-11-20
What is the maximum number of characters you can put on a BSTR?
0
Comment
Question by:lucent2000
[X]
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
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C++ BOOL WINAPI ReadFile fails on windows 10 when reading from USB cable 9 519
Named range not carried over 10 66
JQuery serialize and unserialize 8 195
Work with App store 7 94
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…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.

749 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