I am writing a code to control a portable radio in visual basic and have one single error that is AddressOf' expression cannot be converted to 'Long' because 'Long' is not a delegate type coming from the one line of code below.
I have googled and read every result on the first 3 pages and cannot find anything that fixes this issue or makes any sense to me. I have been doing visual basic for some time so understand the basics.
Any help with be very much appreciated.
Code:
ret = SETCALLBACK(comport, AddressOf IncomingMessageHandler)
which is part of this sub-routine
Dim ret As Byte
Dim comport As Byte
comport = 1 'Use com1
ret = SETCALLBACK(comport, AddressOf IncomingMessageHandler)
'ret = 0 for no error, 1 for com port in use, 2 for no com port
Any help with be very much appreciated.