VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Pointer to a Function using the AddressOf Operator

by Nokiocab25 (3 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 6th January 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Pointer to a Function using the AddressOf Operator

API Declarations



' Techically pointers don't exist in VB, but there are ways to find an
' address of a function.

' This becomes important when using API's and Callback Procedures

Rate Pointer to a Function using the AddressOf Operator



Private Function DummyFunc(ByVal lParam As Long) As Long
  DummyFunc = lParam
End Function

' A Function....
Private Function MyFunction() As Long
  MyFunction = 0
End Function

' This Function will Return the Adrress of 'MyFunction'
Private Function GetAddress() As Long
  GetAddress = DummyFunc(AddressOf MyFunction)
End Function

Download this snippet    Add to My Saved Code

Pointer to a Function using the AddressOf Operator Comments

No comments have been posted about Pointer to a Function using the AddressOf Operator. Why not be the first to post a comment about Pointer to a Function using the AddressOf Operator.

Post your comment

Subject:
Message:
0/1000 characters