CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: AddressOf

  1. #1
    Join Date
    Feb 2001
    Location
    Israel
    Posts
    94

    AddressOf

    I am trying to send the Address of a Function to a COM DLL but as I run it I get an error saying invalid use of AddressOf.
    Why is that?
    how to overcome it?

    FatMan


  2. #2
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: AddressOf

    Try the seemingly stupid solution as follows:

    public Function LongFromLong(byval lIn as Long) as Long

    LongFromLong = lIn

    End Function




    And then in your call, use:

    LongFromLong(AddressOf foo)




    HTH,
    Duncan

    -------------------------------------------------
    Ex. Datis: Duncan Jones
    Merrion Computing Ltd
    http://www.merrioncomputing.com
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

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

Featured