Tip

COM components in Visual Studio .NET

The .NET environment is different from what we've had before, so it's pretty clear that ordinary things you used to do will now have different procedures associated with them. This tip, which has been excerpted from InformIT,

    Requires Free Membership to View

offers a step-by-step procedure for referencing COM components inside the .NET framework.

The steps for referencing a COM component's type library are:

  • Start Visual Studio .NET and create either a new Visual Basic .NET console application or a Visual C# console application. The remaining steps apply to either language.
  • Select the Project, Add Reference... menu. There are two kinds of components that can be referenced: .NET and COM. The default .NET tab shows a list of assemblies. To add a reference to a COM component, click the COM tab. This tab should be familiar to Visual Basic 6 users, who reference a COM component's type library the same way (using the Project, References... menu in the Visual Basic 6 IDE).
    The list of components consists of type libraries that are registered in the Windows Registry (under HKEY_CLASSES_ROOTTypeLib). Each name displayed is the contents of the library's helpstring attribute, or the library name if none exists. To add a reference to a type library that isn't listed, click Browse… and select the file. This registers the type library, so the next time it is listed in the dialog. You should double-click Microsoft Speech Object Library in the list to try the upcoming example.
  • Click the OK button.

To read the entire tip from which this tip comes, click over to InformIT. You have to register there, but the registration is free.


This was first published in September 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.