HighTechTalks DotNet Forums  

Newbie to COM Interop

Dotnet Framework (Interop) microsoft.public.dotnet.framework.interop


Discuss Newbie to COM Interop in the Dotnet Framework (Interop) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
=?Utf-8?B?Q2hyaXMgRGF2b2xp?=
 
Posts: n/a

Default Newbie to COM Interop - 08-20-2007 , 03:46 PM






I'm trying to just learn how to call a COM component from a .Net application.
I am using visual studio 2005. Is there some sort of step by step tutorial or
book or something that somone can suggest. I'm real confused on how to do
this and just googleing does not get me a real good clear answer.

Anybody out there to help me?

--
Chris Davoli


Reply With Quote
  #2  
Old   
Phill W.
 
Posts: n/a

Default Re: Newbie to COM Interop - 08-21-2007 , 08:13 AM






Chris Davoli wrote:

Quote:
I'm trying to just learn how to call a COM component from a .Net application.
At its /most/ simple, add a reference to the COM component; Visual
Studio will create you an InterOp Assembly (local to your current
project) that allows you to call the methods on the COM object and wires
up any necessary data type conversions and the like.

Beyond that, you're looking at the "tlbimp" utility (if you need to put
/your/ Assemblies into the Global Assembly Cache then you'll need tlbimp
to "Strongly Name" the generated InterOp Assembly).

And, if you're playing with automating MS Office then you'll need to
read up on its "Primary InterOp Assemblies".

HTH,
Phill W.


Reply With Quote
  #3  
Old   
=?Utf-8?B?Q2hyaXMgRGF2b2xp?=
 
Posts: n/a

Default Re: Newbie to COM Interop - 08-21-2007 , 11:44 AM



Thanks Phil.

So what your saying, if I want to just call the com component, just adding a
reference to it in the local project without GAC'ing it, will do it. Is that
true? Sounds pretty easy.

--
Chris Davoli



"Phill W." wrote:

Quote:
Chris Davoli wrote:

I'm trying to just learn how to call a COM component from a .Net application.

At its /most/ simple, add a reference to the COM component; Visual
Studio will create you an InterOp Assembly (local to your current
project) that allows you to call the methods on the COM object and wires
up any necessary data type conversions and the like.

Beyond that, you're looking at the "tlbimp" utility (if you need to put
/your/ Assemblies into the Global Assembly Cache then you'll need tlbimp
to "Strongly Name" the generated InterOp Assembly).

And, if you're playing with automating MS Office then you'll need to
read up on its "Primary InterOp Assemblies".

HTH,
Phill W.


Reply With Quote
  #4  
Old   
Phill W.
 
Posts: n/a

Default Re: Newbie to COM Interop - 08-22-2007 , 04:48 AM



Chris Davoli wrote:

Quote:
So what your saying, if I want to just call the com component, just adding a
reference to it in the local project without GAC'ing it, will do it.
Yes.

Quote:
Is that true?
It's certainly worked for me in the past.
Mind you, I tend to work with components that are reused machine-wide,
so I end up putting things into the GAC anyway.

Quote:
Sounds pretty easy.
Of /course/ it is - this is Visual Studio :-)

I does all /sorts/ of "Good Things" for you, without you even having to
know what they are... Yeah; right! ;-)

Regards,
Phill W.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.