
Using COM Objects from VB (Object Picker Dialog)
You're working harder than you need to :) Com interop from within the
VS.Net environment can be pretty automatic. If you create a project
reference, choose a com .dll, it will automatically create a COM+ wrapper
that allows you to use the COM object within your project.
To do this:
1. In the VS.Net IDE right click on the project in the solution explorer
2. Select "Add reference"
3. Click on the tab labeled "COM"
4. Scroll down to the COM object you need to use, select it, click o.k.
Now you'll be able to use your .dll throughout the project ;)
Please note: this adds a reference to the wrapped COM object and you'll
need to use fully qualified name.
For some more information, try the link at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcn...
vaconCOMInteroperability.asp
It has an intro topic, some walkthrough samples.
Chris Innes , Chitra Yalamanchili - Visual Basic QA
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Quote:
> Hi
> I want to use the object picker dialog from VB.Net to populate a textbox
> with a group name. I've never used COM objects before and am having
> difficulty working out exactly what I need to do.
> I found an article on MSDN, rather encouragingly called "Referencing COM
> Objects from Visual Basic .NET" , but found it very unclear and lacking
> in detail. I know that I have to import a type library and use the
> CoCreateInstance function, but I don't know how to find out where the
> type library is or how to use the function properly.
> Please help!
> Julia
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!