I have a VB.NET app that I want to integrate with a couple of other
applications that only support OLE interfaces. Is this likely to be possible
in VB.NET (I don’t want to have to use C++), and if so, how difficult is it?
If it can’t be done, what are the best options to suggest to the vendors of
these other apps for a client interface that will be .net friendly? Web
services are out of the question as the applications will only ever be run on
stand-alone PCs without IIS.
Thanks for your help and advice.
Tim.
Rob Locher - 29 Sep 2004 14:24 GMT
Hi Tim. There's nothing to it most of the time. If you're using
Visual Studio .NET, just add a reference to your project. In the "Add
Reference..." dialog, click on the COM tab, and pick your COM object
from the list. You can also browse to a type lib. You should then
see a reference to your COM component as if it were a .NET namespace.
If all goes well, you can then pretend that it's a .NET assembly
instead of a COM component. That works 95% of the time. If that
doesn't work the problems usually aren't too hard to fix.
The best option if you are dealing with a third party is to ask them
for a "primary interop assembly", which is a .NET wrapper that is
supposed to be created by the author of the component. If you have a
PIA you are pretty much guaranteed to not have integration problems.
You can read up on this stuff in just about any book about Windows
Forms. There are undoubtedly plenty of examples on MSDN and more on
the web.
- Rob
> I have a VB.NET app that I want to integrate with a couple of other
> applications that only support OLE interfaces. Is this likely to be possible
[quoted text clipped - 8 lines]
>
> Tim.