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 751049
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:37:17+00:00 2026-05-14T14:37:17+00:00

I know only very little about C++/CLI, but I have a simple problem that

  • 0

I know only very little about C++/CLI, but I have a simple problem that needs a solution. I have a C++/CLI class method that takes a byte-array as a parameter. The array is of a pre-determined length, and can be allocated in C# beforehand. The array is supposed to be filled with data by the C++/CLI method.

How do I declare the method and then call it from C#?

I tried something like having the following in my C++/CLI class:

public ref class C
{
public:
    void FillBytes(array<BYTE^>^ bytes);
};

And then, in C#:

o = new C();
var bytes = new byte[3];
o.FillBytes(bytes);

But that didn’t work at all :).

  • 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-14T14:37:18+00:00Added an answer on May 14, 2026 at 2:37 pm

    Have you tried using byte instead of a BOOL reference?

    void FillBytes(array<System::Byte>^ bytes);
                                    ↑
                               //   no ^ here
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know very little about SQL. My app is running Rails 3.0.9. I have
I know very little about Java but I'm attempting to run this applet from
I have an ICollection that I know will only ever have one member. Currently,
Maybe this is very basic, but I am all confused. I have a simple
I am a tinkerer—no doubt about that. For this reason (and very little beyond
I have searched high and low, but have found very little to achieve my
I know very little about regex so this has proven very challenging for me.
Background: I have extensive experience in web applications, but I have very little or
Pardon me if this has already been asked (I know very little about Data
Recently I heard that there are 9 rules for OOP(Java). I know only four

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.