此外,利用vb函数addressof我们可以作一些研究工作。
建立一个vb标准exe工程,去除form,加入一个.bas文件,于中写入
Attribute VB_Name = "Module1"
Private Sub Main()
Dim a As Long, c As Long
c = getaddress(a, AddressOf Main)
MsgBox ("Start address of Main() is " + Hex(a - 16))
End Sub
Public Function getaddress(a As Long, X As Long)
a = X + 16
End Function