Solved

convert bstr to ASCII

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
convert char array to number in c 5 86
gdb doesn't stop on breakpoint 2 93
delete-remove 14 97
Secondary drive is failing... D Volume 11 14
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…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand opening and writing to files 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.

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