14-04-2009, 01:32 AM
I don't know much VB.Net, but I'm good with C#, so what I can see from this:
'AddressOf' expression cannot be converted to 'Long' because 'Long' is not a delegate type.
is:
Vb.Net does not handle function pointers like VB6, probably it is like it's done in C# (since everything is just .Net). Delegate types are probably needed here.
Create a delegate type: "Delegate Sub MyDelSub()"
Then inside the function create an instance of this type : "Dim del As MyDelSub"
Now you can use the AddressOf function: "del = New MyDelSub(AddressOf YOURFUNCTIONNAME)"
Then to invoke, just use the Invoke function xD: "del.Invoke()"
Good luck!
'AddressOf' expression cannot be converted to 'Long' because 'Long' is not a delegate type.
is:
Vb.Net does not handle function pointers like VB6, probably it is like it's done in C# (since everything is just .Net). Delegate types are probably needed here.
Create a delegate type: "Delegate Sub MyDelSub()"
Then inside the function create an instance of this type : "Dim del As MyDelSub"
Now you can use the AddressOf function: "del = New MyDelSub(AddressOf YOURFUNCTIONNAME)"
Then to invoke, just use the Invoke function xD: "del.Invoke()"
Good luck!