Convert Interface IDL file to C#

Jon Tackabury picture Jon Tackabury · Aug 20, 2009 · Viewed 19.6k times · Source

I have an interface defined in an IDL file that I would like to use in C#. Is there a way to convert the IDL to something usable in C#?

Answer

Vinay Sajip picture Vinay Sajip · Aug 20, 2009

One way is to run MIDL on the IDL to create a type library (.tlb). This requires a library block in the IDL. Once you have the .tlb, you can run tlbimp.exe on it to get a C# definition/Interop DLL.