Alon Gubkin
Alon Gubkin

Reputation: 57129

Tool for creating .NET wrappers for a COM DLL?

Is there any open source tool for automatically generating .NET wrappers for a COM DLL library?

Upvotes: 10

Views: 13584

Answers (5)

Hans Passant
Hans Passant

Reputation: 941455

Yes, the source code for Tlbimp.exe is available. Download it from here...

Upvotes: 4

t0mm13b
t0mm13b

Reputation: 34592

What about tlbimp typelib importer? MSDN documentation is here.

Hope this helps.

Upvotes: 1

Tj Kellie
Tj Kellie

Reputation: 6476

You can use the command line tool for the Type library import tool it will generate an interop assembly for you to use in your project.

The Type Library Importer converts the type definitions found within a COM type library into equivalent definitions in a common language runtime assembly.

If you are using VS.net you will be able to do this through the IDE. Otherwise I believe this tool is freely available (per your open-source request).

Upvotes: 4

3Dave
3Dave

Reputation: 29051

There is no wrapper necessary to use a COM object in .NET. In Visual Studio, right-click your project name in the Solution Explorer, and select "Add Reference." Any registered COM objects will be listed in the COM tab.

Interop wrappers are only necessary when using .NET assemblies as if they were COM objects - not the other way around as you have described in your question.

Upvotes: 11

tobsen
tobsen

Reputation: 5398

You can try to use SWIG which is able to generate wrapper code for 18 languages. Also this MSDN article might be useful.

Upvotes: 6

Related Questions