Convert typed library (.tlb) to .net assembly?
Sometimes we have to use the legacy code(C, C++) in .Net
projects which is provided by third party vendors. Most of the times these guys
will provide, equivalent .net framework typed library (.tlb) of that legacy
code.
Then, how to refer those in our
.net projects and make use of functionality provided by it? Follow the below steps,
- Keep ".tlb" file which is nothing but legacy typed library
- Open windows command prompt
- Go to directory, "C:\Program Files (x86)\Microsoft Visual Studio 8\SDK\v2.0\Bin" or "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin". It depends on which version of visual studio you had.
- Enter the following and execute, TlbImp.exe "E\MyLibrary.tlb". Here, replace "E:\MyLibrary.tlb" with path to your tlb file.
It will import the .net framework type library to assembly.i.e,
.dll and it can be found at path "C:\Program Files (x86)\Microsoft Visual
Studio 8\SDK\v2.0\Bin" with name "MyLibraryLib.dll".
Now we can add reference to this assembly directly like any other .net dll in project and use the functionality of it. It's simple.
Useful post.Dot Net is most supported programming tongue among programming engineers wherever all through the world. It is in like manner considered as most trusted and fruitful stage to build high performing desktop or endeavor application.
ReplyDeleteThanks,
DOTNET Training in Chennai | DOTNET course in Chennai | DOTNET Training Institute in Chennai