FIRSTLY, I WISH TO APOLOGISE FOR POSTING IN THE WRONG FORUM !! (SORRY)
I have made an attempt to ascertain the address of enums when declared (run time). I need a method now to be able to access the memory locations of the individual elements (and contents of each) of each enum declared. ie. I want to be able to retrieve the memory locations of the 5 elements.... Please can someone help?
Declare this in module
VB Code:
Declare Function VarPtrAny Lib "vb60032.dll" Alias "VarPtr" (lpObject As Any) As Long
'Put this bit in form
Option Explicit
Private Ptr1 As Long
Private Enum WorkDays1
Monday
Tuesday
Wednesday
Thursday
Friday
End Enum
Private Sub Form_Load()
Dim lngDay1 As WorkDays1
Ptr1 = VarPtr(lngDay1)
Debug.Print Ptr1
End Sub