Results 1 to 10 of 10

Thread: [RESOLVED] Is it possible to put AddressOf in a variable

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2005
    Posts
    169

    Resolved [RESOLVED] Is it possible to put AddressOf in a variable

    I would like to create a Sub that can transfer an address of a subroutine, I've tried Long and Long_Ptr without success.

    Function WndProc_Sounds
    'working stuff is in here
    End Function

    Function SubClass_iDrive(hWnd as Long, lProc as Long, WndProc as Long) as Long
    'of course the following line works if I use it outside the Function and insert the real variables
    If lProc = False Then lProc = SetWindowLong (hWnd, GWL_WNDPROC, AddressOf WndProc)
    End Function



    My call:
    Dim lProcSounds as Long
    Dim hWndSounds as Long

    hWndSounds = iDriveSound.hWnd

    SubClass_iDrive hWndSounds, lProcSounds, AddressOf WndProc_Sounds


    How can this be accomplished???
    Last edited by vb_lover; Feb 14th, 2016 at 11:10 AM. Reason: spelling

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