How can I add a C++ DLL file in my .NET application?
To create a DLL File, click on New project, then select Class Library. Enter your code into the class file that was automatically created for you and then click Build Solution from the Debug menu. P.S. DLL files cannot be run just like normal applciation (exe) files.
You would use an "extern" function, marked with the DllImport attribute.
[DllImport(@“C:\mylib.dll”)]
public static extern int myFunc(int param);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With