COM Interop

  • Thread starter Thread starter joe
  • Start date Start date
J

joe

I am trying to write an application in vb .net. I am
using two COM objects, the WebBrowser Control and another
object written by an associate. The second object has a
method which takes a pointer to a WebBrowser object as a
parameter. I don't know of a way to get a pointer to the
actual WebBrowser control rather than the wrapper. This
seems like it would be something that a lot of people
would need to do, so please let me know if you know of a
solution.
 
You need the wrapper to wrap the COM object in .NET clothing. This is how
interOp works.
 
Are you saying that what I want to do is impossible? It
would seem that this would greatly inhibit
interoperability. How would you suggest I solve my
problem? Thanks for the response.
 
Well, I want to be sure I understand your question before I say "no".

When you need to utilize any COM object in the .NET world, you MUST make a
reference to the COM object, which, in turn, creates a wrapper class so that
the COM object can impersonate a .NET object.

If you are asking if there is a way to not do that and still use the COM
object, the answer is no. There is a price to pay for InterOp (the wrapper
class), and that can sometimes even cause a degradation in performance
(usually not, but in some circumstances it can). But, there is no other way
to get COM and .NET to talk to each other since they stem from completely
different architectures.
 
Back
Top