I am fairly new to using P/Invoke. So I am able to use P/Invoke currently using this way as said in Microsoft Tutorial:
[DLLImport("msvcrt.dll")]
public static extern int puts(string c);
then just call
public void UsePuts()
{
puts("Testing");
}
However, I am now testing on the actual .dll that I want to use. And I found out by looking at the source code, that it seems that in that one .dll file, there are multiple classes (like Class1.cpp and Class2.cpp).
So for example, I want to use a function from Class1 (puts), and a function from Class2(puts), how should I build my DLLImport? Like this?
[DLLImport("msvcrt.dll")]
public static extern int Class1.puts(string c);
[DLLImport("msvcrt.dll")]
public static extern int Class2.puts(string c);
Or how? Thanks very much!
Check this sample