I have a problem with the following code in VBA7 Microsoft Excell 2010 on Win 7 x64.
VBA7 Microsoft Excell 2010 can't open(find) Everything.dll.
In VBA7 Microsoft Excell 2010 on Win 7 x32 this code runs correctly.
What the problem in Win 7 x64?
I need help.
Public Type Zfilestruct
FullPathFileName As String * 260
PathPartLength As Long ' Length of the path part only
FileNamePartOffset As Long ' Offset into FullPathFileName for the file name part only (0 based)
SizeHigh As Long ' Not used in this example.
SizeLow As Long ' Not used in this example.
Attributes As Long ' Attribute flags can be zero or EVERYTHING_FILE_ATTRIBUTE_DIRECTORY flag
CreationYear As Long ' Not used in this example.
CreationMonth As Long ' Not used in this example.
CreationDayOfWeek As Long ' Not used in this example.
CreationDay As Long ' Not used in this example.
CreationHour As Long ' Not used in this example.
CreationMinute As Long ' Not used in this example.
CreationSecond As Long ' Not used in this example.
CreationMilliseconds As Long ' Not used in this example.
LastAccessYear As Long ' Not used in this example.
LastAccessMonth As Long ' Not used in this example.
LastAccessDayOfWeek As Long ' Not used in this example.
LastAccessDay As Long ' Not used in this example.
LastAccessHour As Long ' Not used in this example.
LastAccessMinute As Long ' Not used in this example.
LastAccessSecond As Long ' Not used in this example.
LastAccessMilliseconds As Long ' Not used in this example.
LastWriteYear As Long ' Not used in this example.
LastWriteMonth As Long ' Not used in this example.
LastWriteDayOfWeek As Long ' Not used in this example.
LastWriteDay As Long ' Not used in this example.
LastWriteHour As Long ' Not used in this example.
LastWriteMinute As Long ' Not used in this example.
LastWriteSecond As Long ' Not used in this example.
LastWriteMilliseconds As Long ' Not used in this example.
End Type
Dim FINDfile As Zfilestruct
Declare PtrSafe Sub Everything_SetSearch Lib "Everything" (ByVal Zfilter As String)
Private Declare PtrSafe Sub Everything_Query Lib "Everything" ()
Declare PtrSafe Function Everything_GetNumResults Lib "Everything" () As Long
Declare PtrSafe Sub Everything_GetResult Lib "Everything" (ByVal Xnumber As Long, ByRef Xfile As Zfilestruct)
Sub start()
Everything_SetSearch (Cells(1, 1).Text)
Everything_Query
num = Everything_GetNumResults()
For i = 0 To num - 1
Everything_GetResult i, FINDfile
Cells(i + 1, 3) = FINDfile.FullPathFileName
Next i
End Sub
Declare PtrSafe Sub Everything_SetSearch Lib "Everything" (ByVal Zfilter As String)
Private Declare PtrSafe Sub Everything_Query Lib "Everything" ()
Declare PtrSafe Function Everything_GetNumResults Lib "Everything" () As Long
Declare PtrSafe Sub Everything_GetResult Lib "Everything" (ByVal Xnumber As Long, ByRef Xfile As Zfilestruct)
Declare PtrSafe Sub Everything_SetSearch Lib "Everything.x64.dll" (ByVal Zfilter As String)
Private Declare PtrSafe Sub Everything_Query Lib "Everything.x64.dll" ()
Declare PtrSafe Function Everything_GetNumResults Lib "Everything.x64.dll" () As Long
Declare PtrSafe Sub Everything_GetResult Lib "Everything.x64.dll" (ByVal Xnumber As Long, ByRef Xfile As Zfilestruct)
Everything_SetSearch is exported as:
Everything_SetSearchA for ANSI and Everything_SetSearchW for Unicode.
Everything_Query is exported as:
Everything_QueryA for ANSI and Everything_QueryW for Unicode.
Declare PtrSafe Sub Everything_SetSearch Lib "Everything" (ByVal Zfilter As String)
Private Declare PtrSafe Sub Everything_Query Lib "Everything" ()
Declare PtrSafe Function Everything_GetNumResults Lib "Everything" () As Long
Declare PtrSafe Sub Everything_GetResult Lib "Everything" (ByVal Xnumber As Long, ByRef Xfile As Zfilestruct)
Declare PtrSafe Sub Everything_SetSearch Lib "Everything.x64.dll" Alias "Everything_SetSearchW" (ByVal Zfilter As String)
Private Declare PtrSafe Sub Everything_Query Lib "Everything.x64.dll" Alias "Everything_QueryW" (ByVal bWait As Long)
Declare PtrSafe Function Everything_GetNumResults Lib "Everything.x64.dll" () As Long
Declare PtrSafe Sub Everything_GetResult Lib "Everything.x64.dll" (ByVal Xnumber As Long, ByRef Xfile As Zfilestruct)
thank you very much for your answers,
but unfortunately for other applications used by me DLL's are not yet available for Office2010 x64.
I'm back on the Office2010 x32 and will use your Everything.dll.
Topic is locked ... yet.
Good luck.