Solved

convert bstr to ASCII

Posted on 1998-09-08
2
708 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 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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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 is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now