Questions tagged [tlbimp]

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

The output of the Type Library Importer (tlbimp.exe) is a binary file (an assembly) that contains runtime metadata for the types defined within the original type library.

COM type definitions usually reside in a type library. In contrast, CLS-compliant compilers produce type metadata in an assembly. The two sources of type information are quite different. The Type Library Importer is used for generating metadata from a type library. The resulting assembly is called an interop assembly, and the type information it contains enables .NET Framework applications to use COM types.

More information is availabe on MSDN, including a guide on how to use it.

91 questions
2
votes
2 answers

Using tlbimp without needing a second assembly?

I am trying to implement a COM interface in my C# dll for others to consume. I have defined an interface in foo.idl. I've run foo.idl through tlbimp to produce foo.dll, a .Net assembly. Now to implement my interface, I can reference foo.dll in my…
LCC
  • 1,170
  • 1
  • 17
  • 28
1
vote
3 answers

Why doesn't TlbImp import this COM interface for DIA correctly into .NET?

I tried to import Microsoft's DIA SDK for use with .NET: call "%VS90COMNTOOLS%\vsvars32.bat" midl /I "%VSINSTALLDIR%\DIA SDK\include" "%VSINSTALLDIR%\DIA SDK\idl\dia2.idl" /tlb dia2.tlb tlbimp dia2.tlb Which seems to work correctly for the most…
user541686
  • 205,094
  • 128
  • 528
  • 886
1
vote
1 answer

Tlbimp .net and COM components still need to be registered

I took a COM DLL and used tlbimp to create a DLL I could use in my .net 3.5 project. I'm getting an error though when try to use the COM interface and I'm wondering if I still need to register the COM dll on the server the app will be installed on?…
user204588
  • 1,613
  • 4
  • 31
  • 50
1
vote
1 answer

tlbimp: how does early binding work with "/noclassmembers"?

I was playing about with tlbimp and I found the /noclassmembers option and I was like: Ahhah! I bet that will break early binding! But, much to my chagrin, everything still seemed to work fine even when using the interop assembly generated with…
user166390
1
vote
1 answer

COM exception: "SerializationException: The input stream is not a valid binary format. The starting contents..."

I have a COM assembly (let's call it com1.dll) that I'm referencing in some C# code. When I Add Reference I see an Interop.com1.dll in under the References node. If I execute the application from Visual Studio, the following code will run…
dbelcham
  • 41
  • 6
1
vote
1 answer

Is COM Wrapper generated by tlbimp is OS version dependent

We are generating Interop dll for wuapi.dll using tlbimp.exe. Is this interop dll genrated by tlbimp.exe dependent on OS version? Are there any dependencies on wuapi.dll that has to be packaged if this has to packaged and installed on client…
Deepak N
  • 2,561
  • 2
  • 30
  • 44
1
vote
1 answer

Compiler Error C3646 'unknown override specifier' in auto generated .tlh when using importlib in idl

I use Visual Studio 2015 and I have a C# Application-Project that defines a COM-Interface and generates a .tlb file on compilation. Now I want to import that Csharp.tlb into an idl. MyLibrary.idl: import "oaidl.idl"; import "ocidl.idl"; import…
MaLe
  • 33
  • 6
1
vote
1 answer

Which features of .NET framework do interop assemblies reference?

We have a Visual Studio solution with about 90 projects. Most of them are built to DLL files, some are written in C++, others in C#. The projects communicate with each other via COM. We use tlbexp to generate TLB files of some C# projects (the ones…
Paul H
  • 600
  • 1
  • 5
  • 13
1
vote
1 answer

Open array declaration lost when regenerating interop.dll with tlbimp.exe from type-lib

I need to regenerate the interop.dll from a type-library. Therefore I fired up TlbImp.exe" foo.tlb /out:interop.dll But in contrast to the original interop.dll, I found out with the object browser (see below) void SetNodeArr(int Size, FOO_NODE[]…
participant
  • 2,923
  • 2
  • 23
  • 40
1
vote
1 answer

Can't register tlb on other computer

I could create a dll from vb.net visual studio 2012 and using options, register for COM interop, this has generated me a .tlb file, the same been able to reference it from a project in vb6 and use its features, all this is happening in my pc. But…
1
vote
2 answers

.Net to COM Interop Tester

I made a class in C# that I am exposing to COM. I can register it just fine using RegAsm.exe. I would like to test it before I send it off, but using TlbImp.exe gives me an error of "Type libaray was exported from a CLR assembly and cannot be…
isorfir
  • 771
  • 2
  • 8
  • 19
1
vote
0 answers

What is the correct way to import a type library in Visual Studio?

Background Our build uses ant and a custom task to build Visual Studio projects/solutions as well as some Java projects. There structure is basically a large tree and artifacts from the projects are typically copied upwards to a common build…
steinybot
  • 5,491
  • 6
  • 37
  • 55
1
vote
2 answers

What's the msbuild path to Exec tlbimp from a csproj?

I want to run a prebuild target which I'm coding up in a csproj. This needs to run tlbimp to produce a dll my project references. I'm trying to exec tlbimp, but am getting errors that it can't be found. Is there an msbuild variable or environment…
Scott Langham
  • 58,735
  • 39
  • 131
  • 204
1
vote
2 answers

Getting COM Exception 80040154 on different machine

I am getting following problem, can someone help please? I used Tlbimp utility and converted VB6 COM DLL into RCW DLL. From my Visual Studio 2008, I used "Add Reference" and used that DLL in c# class. Everything works fine on my machine. But if…
abc
  • 11
  • 2
1
vote
0 answers

How to access a CoClass that exposes multiple interfaces through COM InterOp?

I've got a CoClass that is describes as below: [ uuid(xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx), version(1.0), helpstring("FooBar") ] coclass FooBar { [default] interface IFoo; interface IBar; } So my questions are: Why does…
Carsten
  • 11,287
  • 7
  • 39
  • 62