Databases Reference
In-Depth Information
Public Const SM_CXFULLSCREEN = 16
Public Const SM_CYFULLSCREEN = 17
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Declare Function MoveWindow Lib "user32" (ByVal hwnd
As Long, _
ByVal X As Long, _
ByVal y As Long, _
ByVal nWidth As Long, _
ByVal nHeight As Long, ByVal bRepaint As Long) As Long
''End of dialog centering declarations
Dim CntrDialog As Boolean
-----------------------------------------------------------------------------------------------------------------------
-----------
AddrOf
Returns a function pointer of a VBA public function given its name. This function gives similar
functionality to VBA as VB5 has with the AddressOf param type.
NOTE: This function only seems to work if the proc you are trying to get a pointer to is in the
current project. This makes sense, since we are using a function named EbGetExecutingProj.
-----------------------------------------------------------------------------------------------------------------------
-----------
Public Function AddrOf(strFuncName As String) As Long
Dim hProject As Long
Dim lngResult As Long
Dim strID As String
Dim lpfn As Long
Dim strFuncNameUnicode As String
Const NO_ERROR = 0
' The function name must be in Unicode, so convert it.
strFuncNameUnicode = StrConv(strFuncName, vbUnicode)
' Get the current VBA project
' The results of GetCurrentVBAProject seemed inconsistent,
in our tests,
' so now we just check the project handle when the function
returns.
Call GetCurrentVbaProject(hProject)
' Make sure we got a project handle... we always should, but
you never know!
If hProject <> 0 Then
Search WWH ::




Custom Search