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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:53:17+00:00 2026-05-26T06:53:17+00:00

I have a windows forms app written in C++/cli. I want to extend this

  • 0

I have a windows forms app written in C++/cli. I want to extend this app with some new forms and I’d like to create them in C# in a separate project.

Is it possible to simply add a C# project to a solution that has the C++ project and the two will interact? By interaction, I mean that, say, a button clicked on a form written in the c# project will be able to call methods in the c++ project. Asked perhaps in a different way, can an object in the C# project reference an object in the c++ project?

  • 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-26T06:53:18+00:00Added an answer on May 26, 2026 at 6:53 am

    Yes. A C++/CLI application will be able to interface with a C# application, in one of two ways:

    If you are using CLI extensions (which from your post it sounds like it), you will be able to write code using the new object references:

    Managed objects: System::String^ myString (in C++) is the same as string myString in C#
    Managed refs: System::String% myString is equivalent to ref string myString.

    If you want to use C++ native types, then you will have to use P/Invoke, but that’s an entirely different category. For what you want to do, just add the C++ project as a reference to your C# project, write a publicly-visible class in C++ using managed types, and then compile. Your project should then be visible to your C# class in whatever namespace you chose for the C++ class.

    Oh, and if you need to allocate managed objects through C++, you will need to use gcnew instead of new.

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

Sidebar

Related Questions

I have a windows forms app with a textbox control that I want to
This is a strange one... In a windows forms app (VB.NET/VS 2005) I have
We have an old Windows 32 bit app written in C++ which does some
I have a Windows Forms app, which I want to convert into an MMC
I have a Windows Form app written in C#. Its job is to send
I have a windows form app written in C#. the main_form class instantiates an
JI have written a .NET C# Windows Form app in Visual Studio 2008 that
I have a Windows Forms app, that has a single ElementHost containing a WPF
I have a windows forms app where I have split different functionality into several
I have created a windows installer for a windows forms app as an MSI.

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.