I would like to implement a MSSCCI provider, however if at all possible I would like to implement it in .Net (so my MSSCCI provider is in fact a thin wrapper around a .Net implementation)
- Is this possible?
- Is this a good idea?
I know that implementing it in .Net would mean that anyone using my MSSCCI provider would be forced to host the .Net framework inside their process - is this an unreasonable request? Also what other limitations would I need to consider if I were to implement it in .Net?
It's possible, and relatively easy. I developed one some time ago and it works fine. I used COM interoperability from C++ to C#.
So, you will create two dlls. The C++ one is only a wrapper that implements the API pass the calls to a COM in C#. The C# one must be registered as a COM component with regasm /codebase mycomlibrary.dll
Here are some guidelines to implement it. In the code sample I only implement the
SccInitialize
function as an example. Hope it helps.This is the C++ component:
And then the C# part is simpler:
}