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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:50:32+00:00 2026-05-31T02:50:32+00:00

When I call a the C++ function: public ref class TEST_CLASS { void TEST(void

  • 0

When I call a the C++ function:

public ref class TEST_CLASS
{
    void TEST(void (*func)())
    {
        (*func)()
    }
};

in C#:

TEST_CLASS t = new TEST_CLASS();
t.TEST(f);

I get the error:

‘TEST’ is not supported by the language

What would be causing this error? How can I fix it?

  • 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-31T02:50:33+00:00Added an answer on May 31, 2026 at 2:50 am

    When I call a the C++ function:

    That’s not C++ code, you wrote a C++/CLI class. Note the ref class keyword. You declared the method to take a C function pointer. That’s fine in the C++/CLI language, it lets you mix native and managed code constructs, but not fine to a language like C# or VB.NET. They insist that you use the managed version of a function pointer, a delegate.

    There’s already a delegate type in the .NET framework that matches the signature of your C function pointer, MethodInvoker. But let’s assume you want to extend on the signature and add, say, your own arguments and return type:

    public ref class TEST_CLASS
    {
    public:
        delegate void TEST_delegate();
    
        void TEST(TEST_delegate^ func)
        {
            func();
        }
    };
    

    Picking that name kinda hurt.

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

Sidebar

Related Questions

I have the following function in C++ managed (ref) class: public static void Transform(Bitmap^
Can I call public method from within private one: var myObject = function() {
I am getting compile error candidate function(s) not accessible when calling certain members, although
When testing with phpunit, I want to assert a function call: Given a Class:
How do you call function lol() from outside the $(document).ready() for example: $(document).ready(function(){ function
Is it possible to call function within the same function without specifying the function
I'm having hard time with this simple ajax call function sendreq() { $.ajax({ dataType:
I was learning through javascript's context and .apply() and .call() function and am having
I have encounters this abap snippet that I have difficulty to comprehend. call function
I have a HTML page, with html-mode enabled. I call function sgml-validate to check

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.