tlbimp

Lots of build warnings when COM objects ActiveDs or MSXML2 are referenced

After moving a project from .NET 1.1 to .NET 2.0, MsBuild emits lots of warnings for some COM objects. Sample code for test (actual code doesn't matter, just used to create the warnings): using System; using System.DirectoryServices; using ActiveDs; namespace Test { public class Class1 { public static void Main(string[]...

Manually generate ActiveX wrapper after TLBIMP-ed dlls?

I have several ActiveX components that needed to be accessed from a C# project. I can import them via Visual Studio's add reference dialog, which will also automatically generate wrappers class. (i.e. ABCLib and AxABCLib) I know that I can generate the primary interop assembly manually by running TLBIMP /primary on each individual OCX ...

Tool to import Type Libraries as C# code

Is there a tool to import/convert COM type libraries into C# code rather than generating an assembly? The TLBIMP tool and the TypeLibaryConverter class only generate assemblies. I've had some success ripping the C# ComImport definitions by running Reflector over the generated Interop assembly and copying a pasting the disassembled sourc...

Compiler Error when adding dll reference to managed c++ project

Hello, I am using VS 2008 and get compiler errors sporadically when adding a dll reference to a managed c++ file in my C++ project. I am trying to add a reference to the dll so as to be able to use smart pointers. ex: #import items.tlb The problem is that the compiler crashes at sporadic places inside of items.tlh almost as though chun...

Referencing a COM assembly in Visual Studio vs converting a COM assembly via tlbimp.exe

When I import a COM assembly (dll) in to a Visual Studio project by adding it as a reference I can use the generated equivalent common language runtime assembly without issue. However if I try and convert the same COM assembly into a common language runtime assembly using tlbimp I run in to all kinds of problems. Is there a way to repl...

COM Interface question - .NET

Hi Recently I was reading about interop marshalling but I still don't understand one thing. To make .NET assembly visible to COM I need to use tlbexp tool and/or regasm tool. To make COM visible to .NET assebly I have to use tlbimp tool - all that is clear for me. Apart from that, I've seen on the internet a lot of code dealing with C...

How can I get tlbimp to not automatically generate assemblies for referenced types?

I want to create an interop assembly from a type library using the tlbimp.exe tool that is included in the .NET SDK. My problem is that the source type library is referencing a type in another library that I do not have available. How can I get tlbimp to not automatically generate assemblies for referenced types? I get the following e...

Where is the Wrapper Assembly Key File setting in VS 2008?

I'm trying to build an application that is strongly named. It is referencing a COM interop library that I add via the Add References dialog. It's been a while, but I seem to recall that in older versions of visual studio, there was a project setting for Wrapper Assembly Key File. I can't seem to find it in Visual Studio 2008? ...

Suppress tlbimp warnings in visual studio

In a visual studio C# project, it is possible to add references to COM libraries. Visual Studio will then use tlbimp.exe to generate the interop assembly when building the project. The reference looks like this in the .csproj file: <ItemGroup> <COMReference Include="TDAPIOLELib"> <Guid>{F645BD06-E1B4-4E6A-82FB-E97D027FD456}<...

TLBIMP.EXE - Error TI0000 - *.dll is not a valid type library

Hello! While building our project on the Build Server, the compilation fails with the error message: TlbImp: error TI0000 : The input file 'C:\*.dll' is not a valid type library. We tried to manually invoke the TlbImp command thru the VS2005 Command Prompt and the same error message appeared. To investigate, we tried to create a cle...

using classes inside a COM exe from .Net

I have a .exe file I've been given which has COM classes inside it -- these are from C++, not .net ComVisible types I'd like to use those classes inside my .net project, but I can't add a reference to the exe; when I try I get DIALOG BOX: --------------------------- Microsoft Visual Studio --------------------------- A reference to ...

How to use tlbimp.exe's /keycontainer switch?

Anybody have an example of how to use tlbimp.exe's /keycontainer command line switch? The googles...they don't help. It's always /publickey, or /keyfile. No example of using /keycontainer. ...

Convert TLB file to assembly with custom assembly information

I am using tlbimp.exe to generate an assembly from a TLB file. I know that I can use the "asmversion" command line switch to set a custom version number, but how do I set the other information? I would like to set the fields like "Product Name" and "Company", but I don't see a way to do this. Can it be done with tlbimp, or any other tool...

The type library importer encountered an error during type verification

I am writing a C# application which has several COM references. When I attempt to build it I get the following error for some of them: c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1418,9): error MSB3303: Could not resolve COM reference "70850f66-869f-44a0-88e7-b0460a7e3bf3" version 0.1. The type library importer e...

How do i use TLBIMP.EXE ?

I've found it in my visual studio folder, but when i open it it simply loads and closes instantly. is that the right way to reach to it's functionalities ? ...

Getting COM Exception 80040154 on different machine

Hi All, 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 someone else use the same project on his/her machine then on that machine they get fo...

Com Server: .tlbimp.exe does not recognize methods with pointer parameters

I am writing a comserver that have a pointer as parameter: STDMETHODIMP TServerDidleComTestImpl::GetMyObject(IDummyComObj** outObj) { //Do stuff } When I am writing a client in c++ I have no problem with this method, but when trying to write a .Net client the tlbimp.exe says: Type library importer has encountered a method with...

Returning S_FALSE from a C# COM dll

I have a method defined in IDL as follows : interface IMyFunc : IDispatch { [id(1), helpstring("method GetNextFunction")] HRESULT GetNextFunction( [in,out] long* lPos, [out, retval] BSTR* bstrName); } Using C++ I always implemented this as follows : STDMETHODIMP CMyFunc::GetNextFunction(long *nID, long *lPos, BSTR *bstrNa...

Visual Studio 2010, TlbImp generates .net 4.0 interops in 2.0 projects

In a C# project we add a reference to a COM object via the Add References setup pointing to a COM object which results in the IDE auto-generating the interop assembly. So this is fine and good, but we are building based on .net 3.5 SP1 aka CLR 2.0, and the generated interops are using the 4.0 CLR making them incompatible. Is there a way ...

tlbimp.exe error: Referenced type library 'stdole' does not have a primary interop assembly registered

when I try to import PIA by tlbimp.exe, get the following error: TlbImp : error TI0000 : System.ApplicationException - Referenced type library 'stdole' does not have a primary interop assembly registered. My command is : "C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\tlbimp.exe" "C:..\craxdrt9.dll" /primary /keyfile:"C:..\keyfile....