I'm working to a project formed by a c++ service and a c# graphic interface.
I have to share some classes and functions, then I wrote a c++ dll but I've problems to use it. I'll show my example code to require your help and understand how to resolve. Thanks
But if I try to import it in a c# project, I have problems.
If I try to add dll as reference:
"A reference to "..file.dll" could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component"
If I try directly to import the dll with:
[DllImport("file.dll", SetLastError = true)]
private static extern class Test;
- "Resolved file has a bad image, no metadata, or is otherwise inaccessible. Could not load file or assembly 'file.dll' or one of its dependencies"
- "The referenced component 'WifiMonitorDLL' could not be found. "
- "Error The modifier 'extern' is not valid for this item"