'As Any' is not supported in 'Declare' statements
The Any data type was used with Declare statements in Visual Basic 6.0 and earlier versions to permit the use of arguments that could contain any type of data. Visual Basic supports overloading, however, and so makes the Any data type obsolete.
Error ID: BC30828
To correct this error
Declare parameters of the specific type you want to use; for example.
Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" ( _ ByVal lpBuffer As String, _ ByRef nSize As Integer) _ As Integer
Use the MarshalAsAttribute attribute to specify As Any when Void* is expected by the procedure being called.
Declare Sub SetData Lib "..\LIB\UnmgdLib.dll" ( _ ByVal x As Short, _ <System.Runtime.InteropServices.MarshalAsAttribute( _ System.Runtime.InteropServices.UnmanagedType.AsAny)> _ ByVal o As Object)
See Also
Tasks
Walkthrough: Calling Windows APIs
Concepts
Creating Prototypes in Managed Code