views:

1278

answers:

2

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#?

+4  A: 

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.

Vinay Sajip
A: 

What datatypes/structures are used in the IDL? You should first define the datatypes in C# first if there is no inbuild type already.

You can use the following tool to convert the structures, but you need to verify the ouput manually. http://download.microsoft.com/download/f/2/7/f279e71e-efb0-4155-873d-5554a0608523/CLRInsideOut2008%5F01.exe

DevByDefault