Com component in VS.net

G

Guest

Hi,

I have a question about a com component (.dll) in Visual studio .net.

After I reference a com component, VS.net puts a wrapper on it and the new
dll is in my bin folder. I notice that the com dll isn’t in that same folder.

So, my questions are, after the wrapper is on the dll, do I still need the
com component to run this app? If so, how can I tell after I reference the
dll in my app what version and path the dll is coming from.

And when I deploy this app, do I need to add the com component and register
them?

Thanks

Andre
 
E

Egbert Nierop \(MVP for IIS\)

André said:
Hi,

I have a question about a com component (.dll) in Visual studio .net.

After I reference a com component, VS.net puts a wrapper on it and the new
dll is in my bin folder. I notice that the com dll isn’t in that same
folder.

That's right, that could be any directory. The wrapper, just does a
createobject on the ClassID your COM component exposes.
So, my questions are, after the wrapper is on the dll, do I still need the
com component to run this app? If so, how can I tell after I reference the
Sure.

dll in my app what version and path the dll is coming from.

No, you can't. If you want to know where the actual dll is coming from, you
should read the registry. This might be a bad practice.
You also can create a method or function in your COM dll, which calls
GetModuleFileName() (from kernel32).

And when I deploy this app, do I need to add the com component and
register
them?

Sure, you need to use regsvr32 on the COM Dll.

The wrapper is only doing some 'low-level' .NET calls around your COM dll.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top