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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:38:53+00:00 2026-05-12T08:38:53+00:00

I have an interesting stack of assemblies I want to put together: Common Assembly

  • 0

I have an interesting stack of assemblies I want to put together:

  1. Common Assembly (C# or C++-CLI)

    public class MyBase
    {
    public void MethodA()
    { ... }
    private void MethodB()
    { ... }
    protected virtual MethodC()
    { ... }
    }
    
  2. Test Code Assemblies (all C++-CLI)

    public class MySpecific : public MyBase{
    protected: override MethodC();
    };
    
  3. Test Simulator (C#)

    MySpecific obj = new MySpecific();
    obj.MethodC();
    

While assembly 1 could be C++-CLI to keep things simpler, I’d really like to keep assembly 3 in C#. This is largely an exercise to see if inheritance could be done in either direction, but I also have a real-world case where this stack is useful.

The first problem I find is that the C++-CLI assembly does not compile because it doesn’t recognize MyBase as a class, even though I have a reference to assembly 1 and what looks like the proper namespace.

How do I write classes that are language-portable?

  • 1 1 Answer
  • 3 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-12T08:38:54+00:00Added an answer on May 12, 2026 at 8:38 am

    I think you have to declare MySpecific as a managed class like this:

    public ref class MySpecific : public MyBase { ... }
    

    See the CLI/C++ documentation for details. You will not be able to use old C++ code without modifications, but I think everything you have in mind should be possible.

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

Sidebar

Related Questions

I have an interesting question on initialization. I have the following code: public class
I have an interesting situation that EMF forced me into: abstract class AbstractDog{ ...
I have interesting question. According to MSDN yield syntax : yield return <expression>; //
Updated-2 I have interesting combination of warnings & errors. Firstly, when debugging, i get
I have an interesting scenario. I have a task model which has a task
I have an interesting dilemma to which, I hope, someone may have an answer.
We have an interesting problem with WCF binding and streaming transfer mode that we
I have this interesting obstacle on my project. I am currently doing a MVC3
I have some interesting problem for an hour.. In my flex project, all width
I have an interesting SQL problem that I need help with. Here is 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.