13-04-2009, 10:49 PM
I've started to convert my source to VB.Net and I've hit a snag.
With the byte array packet system Dugor designed, he uses a function called "GetAddress" and then calls it with the addressof for each sub that handles a packet.
In VB6, this is a perfect method to use. In VB.Net, it bitches, saying:
Here's an example of how AddressOf is used:
And here's the GetAddress function:
Anyone here know anything about VB.Net? I'm using VB2008..
Once I figure this out, I can keep moving, but I'm at a loss.
Thanks guys.
With the byte array packet system Dugor designed, he uses a function called "GetAddress" and then calls it with the addressof for each sub that handles a packet.
In VB6, this is a perfect method to use. In VB.Net, it bitches, saying:
Code:
'AddressOf' expression cannot be converted to 'Long' because 'Long' is not a delegate type.
Here's an example of how AddressOf is used:
Code:
HandleDataSub(modEnumerations.ClientPackets.CGetClasses) = GetAddress(AddressOf HandleGetClasses)
And here's the GetAddress function:
Code:
Public Function GetAddress(ByVal FunAddr As Long) As Long
GetAddress = FunAddr
End Function
Anyone here know anything about VB.Net? I'm using VB2008..
Once I figure this out, I can keep moving, but I'm at a loss.
Thanks guys.
