Results 1 to 13 of 13

Thread: Visual Basic “AddressOf expression cannot be converted to long”

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2014
    Posts
    4

    Question Visual Basic “AddressOf expression cannot be converted to long”

    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.

    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
    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.
    Last edited by russc155; Mar 10th, 2014 at 02:43 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width