I\'m pretty new in C#. I have Dll written on C++ by myself and I\'m going to use functions from that dll in C# app.
So, I do the following when declare functions in
public static __declspec(dllexport) int captureCamera(int& captureId);
is that method? If it is function, it cannot be static, as static
and dllexport
are mutually exclusive.
And the name is mangled. See http://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B_Name_Mangling. If you can get the mangled name, and then provide the DllImport
with it (EntryPoint=MANGLED_NAME
), it should work.
You can provide linker with .def
file, containing definition of exported functions, and their names aren't mangled then:
Project.def:
EXPORTS
captureCamera @1