![]() |
How to call a c++ function from c# program
Hi,
Can any of you, tell me how to call c++ functions from c# program? I have a C++ dll, in which i have some functions, now i want to call them from my c# code. Please tell me how can i do this. If possible provide me sample code n all. Thank you in advance Bye, sree |
Re: How to call a c++ function from c# program
[ Late reply, but this may help others :smile: ]
Well, I think that should not be too difficult. You can use DllImport. Say you have the following C++ func in a dll : Code: c++
So, you can use it like this : Code: c#
Simple, isn't it ? PS : Just embed a manifest to avoid the error : "An application has made an attempt to load the C Runtime library without using a manifest." |
Re: How to call a c++ function from c# program
Very well explaind Saswat and also for creating the DLL you can refer to Creating a simple DLL
|
Re: How to call a c++ function from c# program
Quote:
|
| All times are GMT +5.5. The time now is 06:30. |