Page 1 of 2 12 LastLast
Results 1 to 15 of 18
  1. #1
    Miles R is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Mar 2019
    Posts
    280

    Different result from Shell32.ParseName with Windows 11 64 Bit Access

    I have copied my Windows 10 32 Bit Access application to my new Windows 11 64 Bit Access application and was hoping it would be a flawless transfer.


    No such luck. Most seems to be OK, but there is a problem accessing Photo attributes.

    On the Windows 10, when I use :

    Set shlFolderItem = gshlFolder.ParseName("Filexyz.jpg"), it sets the shlFolderitem to "Filexyz.jpg"
    (shlFolderItem is declared as Shell32.FolderItem and gshlFolder is declared as Shell32.Folder

    When I do the same on the Windows 11 version, the result is just "Filexyz", i.e. without the file type.
    This causes the subsequent GetDetailsOf code to fail.

    Anyone encountered this and know the solution?

    Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I've never used Shell to get file properties. What properties do you want?
    How does filename get fed into ParseName()?
    Post your procedure. Be sure to use CODE tags.

    I tested in both systems and get same output - with file extension.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Miles R is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Mar 2019
    Posts
    280
    Quote Originally Posted by June7 View Post
    I've never used Shell to get file properties. What properties do you want?
    How does filename get fed into ParseName()?
    Post your procedure. Be sure to use CODE tags.

    I tested in both systems and get same output - with file extension.

    June7,
    Thanks for the reply. I want properties such as Iso Speed etc.

    The code is exactly as I described. The filename is the name of one of my picture files.

    How are you getting the file properties without using Shell?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I tested the Shell object.

    Scripting.FileSystemObject will also provide file properties, but don't know if it will have the properties you want.

    What property provides ISO speed? Again, you could provide your procedure.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Isn't ISO an EXIF tag property? Don't think you'll get that with FSO.
    EDIT - could be wrong about that though.
    EDIT2 - actually I think it's doable with WIA - Window Image Acquisition. I used it a few years ago to do things like flip/reverse images.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    Miles R is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Mar 2019
    Posts
    280
    Thanks for the replies.
    Yes ISO speed is an EXIF tag, along with Focal Length and Exposure time etc.

    June 7, not sure what you mean by provide your procedure?
    ParseName and GetDetailsOf are not my procedures, they are Shell procedures. I am just calling them to get the EXIF tags - well actually it is GetDetailsOf that gets the Tag, when you provide the correct offset.
    https://learn.microsoft.com/en-us/wi...r-getdetailsof
    But to do this you need to supply the correct FolderItem, which ParseName is supposed to supply.

    This works perfectly well on my Windows 10 32 Bit Access system, so something must be different on the new one. May be some setting that I am going to have to spend a long time investigating, unless someone else has come across this problem and knows the solution.
    Last edited by Miles R; 12-06-2024 at 04:02 PM. Reason: spelling

  7. #7
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Maybe look into ptrSafe (pointers for API's)?
    I didn't use Shell either, since I found a whole library for modifying image files. Didn't try to work with EXIF tags, but WIA is supposed to be able to work with those.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    Miles R is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Mar 2019
    Posts
    280
    Think I am near to solving this. The issue was not with getDetailsOf, which seems to work whether the Folder Item has a file extension or not.
    The issue was with a comparison I was making on Folder Item to check what file type the file is. Since there is no file extension returned from the ParseName in Windows 11 (on my system anyway), it was taking the wrong code path.
    Will have to do a different comparison somehow.
    I think I will mark this thread as solved.

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I am talking about your entire procedure that is using the Shell object and methods. I had not caught on that GetDetailsOf was a method of Shell and not a custom function. I tested code from link and still get filename with extension. So how do you implement code to return ISO speed?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  10. #10
    Miles R is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Mar 2019
    Posts
    280
    June7, it is quite complicated.
    This is the general idea :

    /CODE]
    Public gshlFolder As Shell32.Folder
    Dim shlFolderItem As Shell32.FolderItem


    Set gshlFolder = gobjShell.Namespace(<path to file>)
    Set shlFolderItem = gshlFolder.ParseName(<file Name>)
    strAttribute = gshlFolder.GetDetailsOf(shlFolderItem, gintFattISOSpeed)
    [/CODE]


    In this case gintFattISOSpeed is 264.
    You have to know the index for the File Attribute (EXIF) that you want to obtain.
    These numbers can change as I have found to my cost, when Windows versions change, so I don't rely on a fixed value.
    What I do is to find the numbers for all EXIF values I want at the start of the program, by running some other code.
    This is done using the name of the attribute, which does not change - so far anyway.


    e.g.


    /CODE]
    gintFattExposureTime = GetOffset("Exposure time")
    gintFattFStop = GetOffset("F-stop")
    gintFattFocalLength = GetOffset("Focal length")
    gintFattISOSpeed = GetOffset("ISO speed")
    [/CODE]


    where GetOffset is a local routine to go through all EXIF values trying to find a match.


    /CODE]
    Private Function GetOffset(ByVal strAttribute As String)
    Dim intItem As Integer
    Dim strHeaderInfo As String
    Dim intMaxAttrNo As Integer

    ' Loop through all Metadata looking for a match, exit when found.
    intMaxAttrNo = 400 ' Arbitrarily high value.
    For intItem = 0 To intMaxAttrNo
    strHeaderInfo = gshlFolder.GetDetailsOf(gshlFolder.Items, intItem)

    If strHeaderInfo = strAttribute Then
    Exit For
    End If
    Next
    End Function
    [/CODE]

  11. #11
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Your CODE tags didn't work because of / in place of left bracket. Click the # icon on toolbar to get correct tags.

    Your function does not return a value. I added GetOffset = intItem just above the Exit For line.

    I get the 264 index for ISO Speed but GetDetailsOf is not outputting anything for ISO Speed. I do get F-Stop data.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  12. #12
    Miles R is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Mar 2019
    Posts
    280
    Never mind nitpicking about the error in the code tags, what about the code that I went to great lengths to provide in answer to your question?

  13. #13
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    I already edited my previous post to address that.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  14. #14
    Miles R is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Mar 2019
    Posts
    280
    June7,

    Must have missed the GetOffset = intItem when I copied and pasted the code.

    As for ISO Speed, you should get a value such as "ISO-200", if the value is set in the properties. Have you checked the ISO value for the file using Properties and Details?
    If the value is there, GetDetailsOf should pick it up.

    Cheers

  15. #15
    Miles R is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Mar 2019
    Posts
    280
    Regarding my earlier post about EXIF values changing and not relying on fixed values, just found out that Frame width, which was 316 on Windows 10 is now 321 on Windows 11, so it is important to find the correct index by name.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 05-01-2023, 08:30 AM
  2. Shell32 error
    By swenger in forum Modules
    Replies: 19
    Last Post: 07-25-2017, 01:54 PM
  3. Replies: 4
    Last Post: 10-07-2016, 05:26 PM
  4. Replies: 3
    Last Post: 12-15-2014, 03:28 AM
  5. Replies: 0
    Last Post: 02-03-2012, 11:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums