Microsoft KB Archive/190459

= BUG: Restricted Function or Interface Error with IDispatch =

Article ID: 190459

Article Last Modified on 5/13/2003

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q190459



SYMPTOMS
If an ActiveX DLL project is set to be binary compatible, and a class module has the name "IDispatch," then any changes made to the module will generate the following error:

Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic.

The above error occurs after the expected Incompatibility error message. However, this error will not occur if neither the project's version compatibility is binary nor the class module name is "IDispatch."



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.



Steps to Reproduce Behavior
 Start a new ActiveX DLL project in Visual Basic. Class1 is created by default. Add a new Class to the project and name it "IDispatch."  Paste the following code in IDispatch's code window: Public Sub AddRef

End Sub

  Paste the following code in Class1's code window: Implements IDispatch

Private Sub IDispatch_AddRef End Sub

 On the File menu, click Make Project1.dll. On the Project menu, click Project1 Properties, and then click the Component tab.</li> In the Version Compatibility Frame, click Binary Compatibility, and then click OK.</li> Comment out the code in "IDispatch" class module.</li> Press the F5 key to run the project, and then click OK to close the Incompatibility error message. Note that the following error occurs:

Function or Interface marked as restricted, or the function uses an

Automation type not supported in Visual Basic.

</li></ol>

Additional query words: kbdss kbDSupport kbVBp kbVBp600bug kbCompiler

Keywords: kbbug KB190459

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.