To convert 'As Any' in VB6 to .NET

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I hope this is the right place to ask this question.

When I tried to convert my VB 6.0 program to .Net, I got an error message
that says, "Declare statement does not support parameters of type As Any".

Here is the part that the error msg indicates;
Public Declare Function TestComunication Lib "TestDll" (ByVal hDev As Long,
ByVal ComCode As Long, ByRef SendData As Any, ByVal SendDataNum As Long,
ByRef ReceiveData As Any, ByVal ReceiveDataNum As Long) As Long

I used 'As Any' as type of 'SendData' and 'ReceiveData' in VB6.0 because the
'TestCommunication' function is called by a lot of different function and
pass the different type of argument (can be long, integer, UDT etc...)

How can I get rid of the error msg and pass the argument with the correct
type?
Thanks in advance.
 
I hope this is the right place to ask this question.

microsoft.public.dotnet.languages.vb.upgrade may bave been a better
group to post to.

How can I get rid of the error msg and pass the argument with the correct
type?

I recommend taking advantage of method overloading, and have one
declaration for each possible parameter type.


Mattias
 
Back
Top