BUG: Visual Basic 6.0 cannot use the .NET method with the ParamArray parameter in Visual Studio .NET (327084)
The information in this article applies to:
- Microsoft Visual Studio .NET (2002), Academic Edition
- Microsoft Visual Studio .NET (2002), Professional Edition
- Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Studio .NET (2003), Academic Edition
- Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
- Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
- Microsoft Visual Studio .NET (2003), Professional Edition
This article was previously published under Q327084 SYMPTOMSMicrosoft Visual Basic version 6.0 cannot use the .NET method with the ParamArray parameter in Microsoft Visual Studio .NET. A compile-time error
is generated by Visual Basic version 6.0 when it tries to consume the .NET method that has the ByRef ParamArray parameter or the ByRef Structure parameter. When the .NET method has the ByRef
ParamArray parameter, you receive the following error message: Compile error:
Function or interface marked as
restricted, or the function uses an Automation type not supported in Visual
Basic When the .NET method has the ByRef Structure parameter, you receive the following error message: Compile error:
User-defined type may not be passed
ByVal CAUSE This problem occurs because Visual Basic version 6.0 does
not let the ParamArray parameter and the Structure parameter be passed to the BYVAL value. This problem occurs with
a .NET property because a .NET property does not let property parameters be
defined by the BYREF value.RESOLUTION To work around this problem, you can define the ParamArray parameter and the Structure parameter as BYREF. For a property, you can add a method with the
ByRef parameter that assigns the property to the private member.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed in the "Applies to"
section.
| Modification Type: | Minor | Last Reviewed: | 9/13/2005 |
|---|
| Keywords: | kbvs2002sp1sweep kbtshoot kbbug kbCOMInterop kbpending KB327084 kbAudDeveloper |
|---|
|