Re: OLE Automation
From: Rob Locher (rob_at_roblocher.com)
Date: 09/29/04
- Next message: Kyle Eberle: "Returning Failed HRESULTS from Managed to Unmanaged code"
- Previous message: gswitz: "Re: I've worked on it all day"
- In reply to: Tim: "OLE Automation"
- Messages sorted by: [ date ] [ thread ]
Date: 29 Sep 2004 06:24:46 -0700
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
Tim <Tim@discussions.microsoft.com> wrote in message news:<BBEDCE44-770D-44CA-84DD-16753154843E@microsoft.com>...
> 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.
- Next message: Kyle Eberle: "Returning Failed HRESULTS from Managed to Unmanaged code"
- Previous message: gswitz: "Re: I've worked on it all day"
- In reply to: Tim: "OLE Automation"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|