Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

convert bstr to ASCII

Posted on 1998-09-08
2
Medium Priority
?
762 Views
Last Modified: 2008-03-10
i wrote aprogram in vb5 that use mscomm how i convert bstr
to ascii.
0
Comment
Question by:alon1
  • 2
2 Comments
 
LVL 2

Expert Comment

by:duneram
ID: 1252543
you should post this over in the VB section  http://www.experts-exchange.com/comp/lang/visualbasic/
0
 
LVL 2

Accepted Solution

by:
duneram earned 200 total points
ID: 1252544
I found some information that may prove to be helpful.

The first 4 bytes of a bstring contains the number of characters (not counting null terminator) in the ascii string.  This means if your string contained "Hello\0World"   the first 4 bytes would hold 11.   In our case it has an embedded NULL character...

There is more info at:  http://www.microsoft.com/oledev/olecom/article3.htm
It is titled "Article 3. Strings the OLE way" and the author is Bruce McKinney.

A c structure might look like:

struct
{
    long length;
    char *text;
} bstr;

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand and use pointers in the C programming language.
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
Suggested Courses

824 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