Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 995099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:40:11+00:00 2026-05-16T06:40:11+00:00

I need to interface a Linux app to a server that uses bstr data.

  • 0

I need to interface a Linux app to a server that uses bstr data. Can I “roll” my own code to make a bstr? I know the basics of a bstr, that it has a header with the byte size minus the null terminator and because of the header it can contain nulls in the middle of the string and basically all the rest of the rules that follow a bstr.

I am not sure on byte ordering the header or more intimate details such as do I pass the data on pointing to the header or the 5th byte like com does? Does anyone know where I can get this information or if anyone has written a bstr type class for linux? Or in general where I can find info on bstr details rather than just general overviews based on the Microsoft libs?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:40:12+00:00Added an answer on May 16, 2026 at 6:40 am

    This may be interesting for you:

    Eric’s Complete Guide To BSTR Semantics

    EDIT: Some more details, as gleaned from that article:

    DISCLAIMER: This is off the top of my head, and my contain serious errors, up to but not limited the destruction of causality and the end of the known universe.

    struct BSTR_data {
        short count;
        wchar_t[] data;
    };
    
    typedef wchar BSTR;
    
    BSTR * AllocateBSTR(wchar * str) {
        if(str == 0) return 0;
        
        short len = wstrlen(str);
        
        BSTR_data * ret = new char[sizeof(short) + (sizeof(wchar_t) + 1) * len];
        
        ret->count = len;
        
        memcpy(ret->data, str, sizeof(wchar_t) * 2 * len);
        
        ret->data[len] = 0;
        
        return (BSTR *)(ret + sizeof(short));
    }
    
    void DeallocateBSTR(BSTR * str) {
        if(str == 0) return;
        
        BSTR_data * bstr = (BSTR_data*)(str - sizeof(short));
        
        delete bstr;
    }
    

    This should give you a good idea of what’s going on. Note that if cross-comparability with Win32 is important, you need to use SysAllocString, etc instead of this code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need an interface to mongodb by which I can treat data in a
I need to create interface MultiLingual, that allows to display object's data in different
I’m building a custom robotish machine that has 8 switches I need to interface
I need to make a graphic interface in Lazarus from which I run miscelaneous
I'm building a program that does network acceleration, and I need to know how
I need to use IP address of the eth0 interface of a PC (Linux
So I have Python code which creates a Linux TAP interface, but it always
I need to make a radiolist in bash script using dialog interface, for example
I am in need of a CLI interface in which I can convert a
I have a LAMP (PHP) web app which need to interface with programs on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.