Hello, i have c++ DLL and 1 program (not code) , that program calls 1 function from DLL, i know only name of that function, now all want to call that function from my application(C#). Is it possible?
Thanks
Hello, i have c++ DLL and 1 program (not code) , that program calls 1 function from DLL, i know only name of that function, now all want to call that function from my application(C#). Is it possible?
Thanks
I'm assuming that you only have the DLL by itself, if you've got a header file as well it would be much easier since you can skip straight to figuring out how to PInvoke it.
First you have to get hold of the function signature so you know the arguments and their types. If it's a C++ DLL you might be able to get this out with Dependency Walker, if it's a C DLL, you might have to look at the actual assembly code to figure out the arguments and their types.
If you do figure out the signature, then you can use PInvoke to call it from C#, look at the PInvoke website for more details and many samples.