I am trying to write a camera control software - I have some factory provided headers and SDK libraries for the camera (I'm assuming they're from the VS6 era) and the hardware, of course. I would like to call these library functions from C# because the interface and some graph- and image displaying seems to be much more easier to write in C#.
What I was thinking of, I would write a C++ code which basically includes the headers and other stuff and wraps these SDK/lib functions into C++ functions. Then I make a DLL from it and use it in C#.
For instance, the initialization in the C++ part:
and I call the initCam(argumen t) function in C# to initialize the camera.
Would this work? I am not sure this is the proper way to call C/C++ libraries from C# and as I tried a couple of things it doesn't seem to be :)
edit:
I hope I posted to the right place, I wasn't sure where to post this question
What I was thinking of, I would write a C++ code which basically includes the headers and other stuff and wraps these SDK/lib functions into C++ functions. Then I make a DLL from it and use it in C#.
For instance, the initialization in the C++ part:
Code:
int initCam(int param)
{
return SET_INIT(param);
//returns with an error code or 0
}
Would this work? I am not sure this is the proper way to call C/C++ libraries from C# and as I tried a couple of things it doesn't seem to be :)
edit:
I hope I posted to the right place, I wasn't sure where to post this question
Comment