PRB: Compile Error when Declaring MSVSAEventSourceInstaller (242867)



The information in this article applies to:

  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
  • Microsoft Visual Studio, Enterprise Edition 6.0

This article was previously published under Q242867

SYMPTOMS

When compiling a Visual Basic project that accesses the Visual Studio Analyzer programming interfaces, the following error may occur:
Compiler error:
Expected user-defined type, not project

CAUSE

The project contains references to both the automatable (Visual Basic and Visual J++) and non-automatable (Visual C++) interfaces.

RESOLUTION

Remove the references to the non-automatable interfaces from Project References.

MORE INFORMATION

To access the Visual Studio Analyzer programming interfaces from within Visual Basic, you need to add two type library references to your Visual Basic project. Once you add the type library references, you can access the methods within the programming interfaces using the Object Browser.

The following libraries are provided for use with Visual Basic:
  • MSVSA Automatable Event Source Installer 1.0 Type Library
  • MSVSA Automatable Inproc Event Creator 1.0 Type Library
The following libraries are provided for use with Visual C++ and should not be referenced in a Visual Basic project:
  • MSVSA Event Source Installer 1.0 Type Library
  • MSVSA Inproc Event Creator 1.0 Type Library

Steps to Reproduce Behavior

  1. Create a Visual Basic project of type ActiveX DLL.
  2. Add references for both the MSVSA Automatable Event Source Installer 1.0 Type Library and the MSVSA Event Source Installer 1.0 Type Library.
  3. Declare an object as follows:
    Dim mESI As MSVSAEventSourceInstaller
    					
  4. Save the project.
  5. Make the DLL.
NOTE: The same error occurs for all Visual Basic project types.

REFERENCES

For more information, see the following in the Microsoft Developer Network (MSDN) Library:

Visual Studio 6.0 Documentation; Visual Studio Documentation; Component, Design and Analysis Tools; Visual Studio Analyzer Reference; Visual Studio Analyzer Concepts; Extending Visual Studio Analyzer; Guidelines for Customizing Your Application

Visual Studio 6.0 Documentation; Visual Studio Documentation; Component, Design and Analysis Tools; Visual Studio Analyzer Reference; Visual Studio Analyzer Language Reference


Modification Type:MajorLast Reviewed:5/8/2003
Keywords:kbEEdition kbnofix kbprb kbVSVisAnalyzer KB242867