Click here to Skip to main content
15,906,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In a common solution, there are 2 projects, one is the c++ project and the other is the c# project.
There is a class in the c# project, as follows:

C#
namespace CSLib
{
Class Person
{
     Private string PersonName = string.Empty;
     
     Public Person (string personName)
     {
          PersonName = personName;
     }
     
     Public string GetPersonName ()
     {
         Return PersonName;
     }
}

Person mPerson = new Person("Jack");
}


So, how c++ engineering calls mPerson.GetPersonName to get Jack

What I have tried:

C++
#using "..\debug\CSLib.dll"
using namespace CSLib;


I only know how to call the class of c# through c++, but not the method of calling his object method
Posted
Updated 10-Feb-18 2:01am

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900