using .c file in c#
I have a .c file which is detecting the marker live and calculating the x and y values.
I want to use that .c file functions in c# so that i can get the x and y values and use them for other purposes.
So should i make a .dll file of that .c file? And what will be the pros and cons of making .dll file of that .c which is constantly detecting marker and providing values and then using them into C#?
will there be any delay or something? And what to look before converting that .c file into .dll as that .c file is linked to 10-12 libraries.
Please help me out.I am new to these forums and i didnt go through if its already posted or not but i m stuck badly thats why posted.Sorry for that.
You can either declare the C functions in a sep. C# module or you can use C++/CLI and create a managed interface to use from C# which talks to the C++. C++/CLI is compatible with both C++ .NET (or any .NET language) and unmanaged C/C++.
Not an expert when it comes with DLLs but can you use DllImport in C# as you use it with calling things like functions from the Win API?
and either use it in an unsafe class/function or do something like
extern static void CalcMarket(int* x, int* y, ...);
extern static void CalcMarket(ref int x, ref int y, ...);