Hi Bruce,
Problem now is working out how to pass a pointer to a string to a *W function.
I'm sure there is a way to do this... but...
Please tell me there's another way of getting at the Win32 file attributes (particularly the archive bit).
... of course there is another way!
For the FileAttributes you could also use the FileSystemObject over the JACOB.
The FileSystemObject can be accessed through
|
MySQL queries
|
1
2
3
|
Library Scripting
C:\WINDOWS\system32\scrrun.dll
Microsoft Scripting Runtime
|
so make sure you have this dll in the system installed. (normally every VB-developer has it)
For the file attributes you could use this class FileSystemObject:
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
|
Option Explicit
Dim myBase As Dispatch
Public Sub FileSystemObject()
myBase = New ActiveXComponent("Scripting.FileSystemObject").getObject()
End Sub
Public Property Get FileAttributes(path As String) As VBA#VbFileAttribute
Dim aFile As Dispatch = Dispatch.call(myBase, "GetFile", path).getDispatch
FileAttributes = New VBA#VbFileAttribute(Dispatch.call(aFile, "Attributes").getInt)
End Property
|
using the class:
|
Jabaco Source
|
1
2
3
4
5
6
7
8
9
|
Option Explicit
Dim myFileSO As New FileSystemObject
Public Sub Command1_Click()
Dim a As VBA#VbFileAttribute = myFileSO.FileAttributes("C:\Test.txt")
MsgBox a.getName & ": " & CStr(a.intValue)
End Sub
|
regards
OlimilO
remarks:
in the next version of the Jabaco framework the getName-function of an enum-value will also deliver all names as flags set in a flag-enum. (so is the VBFileAttributes-enum)