Ahhh, I almost forgot. I pulled a couple of functions out into a more general BAS module. Here those are:
Code:Option Explicit ' Private Declare Function GetMem4 Lib "msvbvm60" (ByRef src As Any, ByRef dst As Any) As Long ' Public Function AddressOfEx(ByVal lProcAddress As Long) As Long ' AddressOf statement actually returns the pointer to the small thunk which checks if code is running or not. ' When you see an object variable in the Watch window the code is stopped. We need to avoid that behavior ' because some interfaces return the HRESULT value and it'll cause unexpected behavior (return S_OK). ' Dim bIsInIDE As Boolean Debug.Assert MakeTrue(bIsInIDE) If bIsInIDE Then GetMem4 ByVal lProcAddress + &H16, AddressOfEx ' Skip thunk. Else AddressOfEx = lProcAddress End If End Function Public Function MakeTrue(ByRef bValue As Boolean) As Boolean MakeTrue = True bValue = True End Function




Reply With Quote