I am trying to write some plugins to work with the Terminal Services Session Broker Plugin Interface. I am very fluent in C# but I have not done any C++ since the late 90's. For the plugin I am writing I plan on communicating with a database and I would prefer to use System.Data.SqlClient
to talk to it as I know it's ins and outs fairly well. I have the Windows SDK which has provided my with the .idl file for the interface (tssbx.idl
). The SDK also provides a C header file (tssbx.h
) and a C source file (tssbx_i.c
).
I have never written a COM server before, and I have been having a lot of trouble finding resources on learning how to read a IDL file and turn it in to C#. Everything I find says "Use TlbImport" but that requires things like the block library
to be in the IDL which tssbx.idl
does not (nor its dependents) implement.
What would be my best option:
- Find a tool for C# that is the equivalent to MIDL for parsing a .idl file in to a .cs file.
- Learn IDL (I have been having trouble finding good guides to learn it) and write the whole thing in C# by hand.
- Write a helper dll using the C files provided and have that call in to my C# dll for my .NET parts.
- Re-learn C++, use the provided .h and .c files, and use the CLR to make my .NET calls.
- Some other option I have not thought of.