I am wondering what’s the way to call a c# class method from C++(Native, not C++ CLI) code? Need simple and elegant way
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Turn your C# assembly into a COM visible one and use COM interfaces. That is the only way to make it work beside self made IPC as far as I know. The problem comes from the .NET environment under which the .NET assembly must run and C++ runs under its native C++ environment.
The only way of communicating is either an IPC mechanism (sockets, …) or use COM, as the processes have to be “decoupled”.
Here is a tutorial for the COM based solution: