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???
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???