| CyberCrasher (3) | |||
|
Hi everybody! 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
I obtain this warning but project is compiled: class 'std::basic_string<_Elem,_Traits,_Ax>' needs to have dll-interface to be used by clients of class 'Test' Did I wrong something? | |||
|
Last edited on
|
|||
| kbw (5375) | ||
http://www.cplusplus.com/forum/general/78467/#msg423146 | ||
|
|
||
| CyberCrasher (3) | |
|
Ok, thanks.. it works importing to a c++ project 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" | |
|
|
|
| kbw (5375) | |
|
I haven't used C# for a while, so I can't remember the details. But I did find this link that you may find helpful. http://msdn.microsoft.com/en-us/library/ms235281%28v=vs.80%29.aspx | |
|
|
|
| CyberCrasher (3) | |
| Ok, thanks kbw.. I resolved with Wrappers! | |
|
Last edited on
|
|