Is the variable type “As Any” still supported in Visual Basic .NET?
Visual Basic 6.0 allows you to declare parameter types using the As Any variable type. This declaration allows you to pass an argument of any type; Visual Basic 6.0 passes the correct information when the call is made. This gives you greater flexibility, but no type checking is performed on the argument when you call the API function. Thus, if you pass an incompatible argument type, the application may generate a run-time exception. Visual Basic .NET does not support declaring Windows API parameters with the As Any variable type. However, a similar effect can be achieved by declaring the same API function multiple times, using different types for the same parameter in each declaration. The Windows API function SendMessage is an example of an instance where you would use the As Any type in the API function declaration in Visual Basic 6.0 code. Depending on the Windows message you are sending, the parameter types required for the message will vary. For example, the WM_SETTEXT message req