Solved

convert bstr to ASCII

Posted on 1998-09-08
2
746 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
[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
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 100 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
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 and use structures in the C programming language.

739 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