Interfacing with API written for .NET

mk1234
mk1234 used Ask the Experts™
on
We need to use an API written to the .NET environment. However, our development environment doesn't subscribe to .NET. But, it fully supports COM framework.
What is a good way for me to access the API written for languages that support .NET?
Is there a COM <-> .NET bridge that is commercially available? Does anyone know of useful links on this subject?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
.Net itself has a COM<->.Net bridge caled Interop. use regasm command line tool to register .Net assembly for use with COM clients.
but even for this to work, you will need .Net framework installed on the system.

Take a look at .Net documentation on regasm and interop

Author

Commented:
All I received from the vendor is a DLL (.NET assembly?) which is compiled for a .NET environment.
Now, are you saying that there is a "regasm" tool (can it be downloaded? or part of visual studio.NET?) that I can can specify commandline parameters to register this .NET assembly for use with COM clients?
Once it is registered, can I use the .NET assembly as if it is a COM server?
Now, how about datatype mismatches and incompatibilities? Do you know of any pre-requisites for a .NET assembly to seamlessly work with COM clients?
You will need to start with a machine that has the .NET framework installed on it. The DLL provided to you by your vendor is probably an "Assembly File" for .NET. This contains all of the .NET classes for the api that you need to use. In order to use this on the system with the .NET framework you will need to register it with .NET. naveenkohli mentioned the regasm.exe utility, however what was not mentioned was the /tlb: option. This option will register your assembly with .NET and genereate a COM compatible type library that you may use in your COM applications. For a COM <-> .NET type reference you may refer to <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconpackagingassemblyforcom.asp">this article</a>. This article also has information that you may find helpful regarding this topic.

Hope this helps

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial