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

  • SEARCH
  • Home
  • 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 6053467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:02:36+00:00 2026-05-23T08:02:36+00:00

I’ve a C++ interface having a public property P which accepts bit value like

  • 0

I’ve a C++ interface having a public property “P” which accepts bit value like 5, 6,7 etc.
Its documentation says:”Set bit mask of group type. Bit 5 is for ‘a’, Bit 6 is for ‘b’,etc.”

Am using this interface in my C# class and the type of this property “P” shown in the metadata is “char” in VS.Net.

How do I pass the bit value of 6 and 7, to this property from my C# code?
Please note that, as mentioned above, a value of type “char” should be passed from C# to this C++ interface, as this is the type which is shown in the metadata in VS.net

Please suggest.
Code:

C++ interface definition as seen from VS.Net IDE–

[SuppressUnmanagedCodeSecurity]
    [Guid("f274179c-6d8a-11d2-90fc-00806fa6792c")]
    [InterfaceType(1)]
    public interface IAccount
    {
        char GroupType { get; set; }
    }

C#:

IAccount objAccount= new AccountClass();
((IAccount)objAccount).GroupType = ??//I need to pass char value here

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-23T08:02:36+00:00Added an answer on May 23, 2026 at 8:02 am

    The char type in C++ is always 8 bits, which presumably means that you’d use a byteto represent the same thing in C#. (This assumes that your C++ platform uses standard 8-bit bytes, since a C++ char is defined as being 1 byte, but a C++ “byte” isn’t necessarily guaranteed to be 8 bits!)

    byte b = 0;
    b |= 1 << 5;    // set bit 5 (assuming that the bit indices are 0-based)
    b |= 1 << 6;    // set bit 6 (assuming that the bit indices are 0-based)
    

    I’m not sure how you’d marshal that value back to your C++ routine, if that’s what you need to do.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a text area in my form which accepts all possible characters from
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
I'm having trouble keeping the paragraph square between the quote marks. In firefox the

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.