dcsimg
Page 3 of 3 FirstFirst 123
Results 81 to 108 of 108
  1. #81

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    1,940

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Can you describe your security settings? I changed my Internet Options control panel Internet zone to High with no change. Is JavaScript active for you? I could not locate the setting to change it (I don't use IE). I'm on Win7 as well and your code works for me, so I'm going to need to replicate the settings on your system that lead to the crash, but first, we can narrow down where the problem lies:
    Please compile and run the ZIP I'm attaching. I have modified your project to log detailed debug information. After, please attach the resulting log file to your reply. I'm also attaching the output from when I run it in case you want to compare it yourself. One thing I've noticed; you know you're zeroing out security id and zone values that weren't zero right? Just wanted to make sure you intended to change them.
    Attached Files Attached Files

  2. #82
    Addicted Member
    Join Date
    Aug 2011
    Posts
    166

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Any problems with using both this and the standard OLE Automation (stdole2.dll) reference that is set by default on any new project?

  3. #83

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    1,940

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    No, there's no conflict, except that it has a couple hidden members, so you need to specify oleexp.IUknown and oleexp.IDispatch if you're using those... IIRC it's only those two, but in any case definitely not any of the knownfolder stuff.

  4. #84

  5. #85

  6. #86

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    1,940

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Update released with fix and completed new things.

    Take note of a change to IContextMenu as it's very commonly used:
    -IContextMenu and IContextMenu2: .InvokeCommand has been changed to a Long, so that both CMINVOKECOMMANDINFO and CMINVOKECOMMANDINFOEX can be used. Use VarPtr(yourcommandinfovar) instead of just yourcommandinfovar.

    ------------------------
    TheTrick - I'd be very interested to see ITransferSource in action in VB; if possible, share code of it being used if you use it?

  7. #87
    New Member SaschaT's Avatar
    Join Date
    Mar 2017
    Location
    Berlin, Germany
    Posts
    4

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Thanks for the new version!

    I just wanted to mention that not all methods of KnownFolderManager can be called. I tried to retreive a list of registered known folders using GetFolderIds but the type definition for this method is not compatible with VB6, so it refused to compile.
    So I changed the definition in exp_main.odl like this:
    Code:
    //    HRESULT GetFolderIds(
    //        [out] KNOWNFOLDERID ** ppKFId,
    //        [in, out] UINT *pCount);
    
        HRESULT GetFolderIds(
            [out] UINT *ppKFId,
            [in, out] UINT *pCount);
    Now we are able to get the list using this demo snippet:
    Code:
    Sub TestKnownFolders()
        Dim oMngr As oleexp.KnownFolderManager
        Dim IFld As oleexp.IKnownFolder
        Dim uid() As oleexp.UUID
        Dim lUIDs As Long
        Dim sGUID As String, sPath As String
        Dim ret As Long, n As Long, i As Long
        Dim lPath As Long, cnt As Long
        
        Set oMngr = New oleexp.KnownFolderManager
        oMngr.GetFolderIds lUIDs, n
        If n > 0 Then
            ReDim uid(n - 1)
            For i = 0 To n - 1
                oleexp.MoveMemory uid(i), ByVal (lUIDs + (i * 16)), 16&
                sGUID = String(255, 0)
                ret = oleexp.StringFromGUID2(uid(i), sGUID, 255)
                If ret > 0 Then
                    sGUID = Left(sGUID, ret)
                    Set IFld = Nothing
                    oMngr.GetFolder uid(i), IFld
                    If Not IFld Is Nothing Then
                        On Error Resume Next
                        IFld.GetPath KF_FLAG_DEFAULT_PATH, lPath
                        On Error GoTo 0
                        If lPath <> 0 Then
                            cnt = cnt + 1
                            sPath = SysAllocString(lPath)
                            CoTaskMemFree lPath
                            Debug.Print cnt, sGUID, sPath
                        End If
                    End If
                End If
            Next i
        End If
    End Sub

  8. #88

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    1,940

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Thanks for pointing that out, the fix will be included in the next release.

    Note too you can copy all the IDs at once, saving MoveMemory calls,
    Code:
    Dim ct As Long
    Dim tpkd As KnownFolderManager
    Set tpkd = New KnownFolderManager
    Dim kfptr As Long
    Dim arfldr() As UUID
    
    
    tpkd.GetFolderIds kfptr, ct
    ReDim arfldr(ct - 1)
    CopyMemory arfldr(0), ByVal kfptr, Len(arfldr(0)) * ct

  9. #89
    Member
    Join Date
    Jan 2015
    Posts
    32

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Retrieving Portable Device Shell Icons

    Hey fafalone, oleexp.tlb works just fine for enumerating Portable Devices, thanks a lot for that!

    This line retrieves an array of pointers to Device IDs:
    Code:
    ret = MyPortableDeviceManager.GetDevices(ByVal VarPtr(pPnpDeviceIDs(0)), cPnPDeviceIDs)
    Walking the array I turn the pointers into strings, the so-called "PNP Device IDs":
    Code:
      For i = 0 To cPnPDeviceIDs - 1
        sPnpDeviceID(i) = PointerToStringW(pPnpDeviceIDs(i))
      Next
    Such a "PNP Device ID" looks for example like this:
    Code:
    \\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
    I can retrieve the display name (e.g. "Moto G (4)" or "Nexus 10") like this:
    Code:
    ret = MyPortableDeviceManager.GetDeviceDescription(sPnpDeviceID(i), VarPtr(bBuffer(0)), lenBuffer)
    But how to retrieve the shell icon (the icon displayed in File Explorer)??? The
    Portable Device API does not seem to provide anything here, at least I don't see
    it.

    Now in Win8.1 and earlier there is a way to retrieve the icon and some other
    shell info using SHGetFileInfoW with a pidl (it does not work with a string,
    only with pidl):
    Code:
    Call SHGetFileInfoW(pidlItem, 0&, sfiW, Len(sfiW), _
          SHGFI_PIDL Or SHGFI_SYSICONINDEX Or SHGFI_TYPENAME Or SHGFI_DISPLAYNAME)
    The desired icon is here now:
    Code:
    sfiW.iIcon
    I can retrieve the needed pidl using SHParseDisplayName on the "PNP Device ID"
    (prefixed with the This PC GUID "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" and
    one backslash):
    Code:
    sPnpDeviceID(i) = "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}" & "\" & sPnpDeviceID(i)
      ret = SHParseDisplayName(StrPtr(sPnpDeviceID(i)), ByVal 0&, pidlItem, ByVal 0&, ByVal 0&)
    Now the problem is: Retrieving that pidl stopped working with Windows 10 version
    1703 (Creators Update) and later!
    I found no way to turn that "PNP Device ID"
    into a pidl. BTW, I think that is a Windows bug and reported it to MS a year
    ago, but never got any reply or fix.

    So, how can I get my shell icon now in all Windows versions?

    Thanks,
    Don

  10. #90

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    1,940

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Can you create an IShellItem? SHCreateItemFromParsingName. If it's visible with an icon in Explorer (and more importantly, check to see if my shell browser shows its icon), you should be able to get one. The first method my browser tries doesn't go through SHGetFileInfo (that's a fallback), it first tries getting the IShellIcon interface, and in the process gets pidls in a different way...
    Code:
    Dim uPI As IParentAndItem
    Dim psf As IShellFolder
    Dim pIcon As IShellIcon
    Dim pidlPar As Long, pidlRel As Long
    Dim lpIcon As Long
    Dim hr As Long
    '[...]
    
                        Set uPI = siChild 'Your IShellItem 
                        uPI.GetParentAndItem pidlPar, psf, pidlRel
                        On Error Resume Next
                        If (psf Is Nothing) = False Then
                            Set pUnk = psf
                            hr = pUnk.QueryInterface(IID_IShellIcon, pIcon)
    '                        DebugAppend "QueryInterface=0x" & Hex$(hr)
                            If hr = S_OK Then
                                pIcon.GetIconOf pidlRel, GIL_FORSHELL, lpIcon
                            Else
                              Dim pidlcb As Long
                              pidlcb = ILCombine(pidlPar, pidlRel)
                              lpIcon = GetFileIconIndexPIDL(pidlcb, SHGFI_SMALLICON)
                            End If
                            If lpIcon = -1 Then lpIcon = 0
                        End If
    If Explorer shows the icon, that will almost certainly work. Worst case scenario, you could enumerate the Computer folder and match it.
    If Explorer doesn't, you're left with manually doing it. The documentation indicates there might be a DevIcon.fil file in the device root, which is a standard icon file you can load. Or, use the device resource key WPD_RESOURCE_ICON. If both of those fail, query for the generic type (WPD_DEVICE_TYPE), and load the default icon for that type.

    (If 'all Windows versions' means even XP or earlier, the interface methods won't work)

  11. #91
    Member
    Join Date
    Jan 2015
    Posts
    32

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Quote Originally Posted by fafalone View Post
    Can you create an IShellItem? SHCreateItemFromParsingName.
    No, SHCreateItemFromParsingName fails with 0x80070057 (E_INVALIDARG).
    It's the same error as SHParseDisplayName returns when trying to get the pidl.

    So I think something about the PNP Device ID might be wrong.

    The pidl is correctly returned for this path (it's the PNP Device ID of "Moto G (4)"):
    ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}

    But it fails with E_INVALIDARG for the 2 subfolders of "Moto G (4)":
    ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SID-{C8DB0001,,63831015424}
    ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SID-{10001,,58525089792}

    In Win8.1 these paths are no problem.
    Last edited by voxy; Jun 20th, 2018 at 12:56 PM.

  12. #92
    Member
    Join Date
    Jan 2015
    Posts
    32

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Quote Originally Posted by fafalone View Post
    ... and more importantly, check to see if my shell browser shows its icon...
    I ran your ucShellBrowse41 project both in Win8.1 and in Win10, each time using my Moto G phone as device to be browsed. Below you see the debug output. To me it looks like your project met exactly the same problem that made me post here: "No IShellItem" So your shell browser cannot browse those folders in Win10 (but it can in Win8.1).
    What's happening there? Windows bug? Can it be worked around?

    Code:
    Win 8.1
    ~~~~~~~
    
    Select device "Moto G (4)" in your Tree:
    [20:49:53] CBD->SelChange
    [20:49:53] DirNavigate item=9,sup=Falsch
    [20:49:53] LVLoadFolder ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33},m_sCurPath=C:\Users\Donald\Desktop\Desk\ucShellBrowse41\Demo,sPrevPath=,GrpMode=0
    [20:49:53] PathAttrib=SFGAO_CANLINK,SFGAO_CANRENAME,SFGAO_FOLDER,SFGAO_HASPROPSHEET,SFGAO_HASSUBFOLDER,SFGAO_STORAGEANCESTOR,
    [20:49:53] ProcessColumns pathidx=9
    [20:49:53] ub=37last=C:\Users\Donald\Desktop\Desk\ucShellBrowse41\Demo,cur=::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
    [20:49:53] MyComp::Get ShellView
    [20:49:53] MyComp::Get FolderView
    [20:49:53] Got colmgt,ct=4
    [20:49:53] NameLookup=System.ItemNameDisplay
    [20:49:53] NameLookup=System.ItemTypeText
    [20:49:53] NameLookup=System.Size
    [20:49:53] NameLookup=System.FreeSpace
    [20:49:53] SetColumns(9)=
    [20:49:53] SetColumns->Finished reconcile
    [20:49:53] SetColumns->Remove System.DateModified
    [20:49:53] InsertListColumn System.FreeSpace
    [20:49:53] excol defwidth=160
    DirChange ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
    [20:49:53] idxCB=9,lp=9
    [20:49:53] pvCreateDetailPaneBkg.pidlPar=114425896,pidlrel=113577680
    [20:49:53] pbh=56
    [20:49:53] btm=56,cx=58,icn=58,sys=32
    [20:49:53] Draw from JM
    [20:49:53] Loaded 0 files and 2 folders
    [20:49:53] MonitorPidl=116732936 ForPath=::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
    
    Select subfolder of device:
    [20:50:38] Set IC flag = TRUE, item=0
    [20:50:38] LVSetSelection full path=::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SID-{10001,,58525089792}
    [20:50:38] pvCreateItemDetailPane()
    [20:50:38] ucWndProc->Error: Typen unverträglich, 0xD
    [20:50:38] LVItemClick 0
    [20:50:38] InfoTip Cnt=2
    [20:50:38] PropsList=prop:System.FreeSpace;System.Capacity
    [20:50:38] Prop=Freier Speicherplatz: 46,6 GB
    [20:50:38] Prop=Gesamtgröße: 54,5 GB
    
    Dbl-click subfolder of device:
    [20:52:37] Got dblclk/ret
    [20:52:37] LVSetSelection full path=::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SID-{10001,,58525089792}
    [20:52:37] LVDoubleClick idx=0,lp=1,file=Interner gemeinsamer Speicher
    [20:52:37] LVDoubleClick.OpenFolder
    [20:52:37] LVLoadFolder ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SID-{10001,,58525089792},m_sCurPath=::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33},sPrevPath=::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SID-{10001,,58525089792},GrpMode=0
    [20:52:37] PathAttrib=SFGAO_FOLDER,SFGAO_HASPROPSHEET,SFGAO_HASSUBFOLDER,SFGAO_STORAGE,SFGAO_STORAGEANCESTOR,
    [20:52:37] ProcessColumns pathidx=38
    [20:52:37] ub=38last=::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SID-{10001,,58525089792},cur=::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SID-{10001,,58525089792}
    [20:52:37] MyComp::Get ShellView
    [20:52:37] MyComp::Get FolderView
    [20:52:37] Got colmgt,ct=8
    [20:52:37] NameLookup=System.ItemNameDisplay
    [20:52:37] NameLookup=System.ItemTypeText
    [20:52:37] NameLookup=System.Size
    [20:52:37] NameLookup=System.Music.TrackNumber
    [20:52:37] NameLookup=System.Music.Artist
    [20:52:37] NameLookup=System.Music.AlbumTitle
    [20:52:37] NameLookup=System.Media.Year
    [20:52:37] NameLookup=
    [20:52:37] No match, pkey={9E5E05AC-1936-4A75-94F7-4704B8B01923, 6}
    [20:52:37] NameLookup=
    [20:52:37] No match, pkey={9E5E05AC-1936-4A75-94F7-4704B8B01923, 13}
    [20:52:37] NameLookup=
    [20:52:37] No match, pkey={9E5E05AC-1936-4A75-94F7-4704B8B01923, 14}
    [20:52:37] NameLookup=
    [20:52:37] SetColumns(38)=
    [20:52:37] SetColumns->Finished reconcile
    [20:52:37] SetColumns->Remove System.FreeSpace
    [20:52:37] InsertListColumn System.Media.Year
    [20:52:37] excol defwidth=80
    [20:52:37] InsertListColumn System.Music.AlbumTitle
    [20:52:37] excol defwidth=136
    [20:52:37] InsertListColumn System.Music.Artist
    [20:52:37] excol defwidth=120
    [20:52:37] InsertListColumn System.Music.TrackNumber
    [20:52:37] excol defwidth=40
    DirChange ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SID-{10001,,58525089792}
    [20:52:37] idxCB=10,lp=38
    [20:52:37] pvCreateDetailPaneBkg.Error->Typen unverträglich, 0xD
    [20:52:37] Loaded 0 files and 15 folders
    [20:52:37] MonitorPidl=123149952 ForPath=::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SID-{10001,,58525089792}
    [20:52:41] terminate event
    
    ========================================================================
    Win 10
    ~~~~~~
    
    Select device "Moto G (4)" in your Tree:
    [20:57:45] CBD->SelChange
    [20:57:45] DirNavigate item=9,sup=Falsch
    [20:57:45] LVLoadFolder ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33},m_sCurPath=::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33},sPrevPath=C:\Users\Public\ucShellBrowse41\Demo,GrpMode=0
    [20:57:46] PathAttrib=SFGAO_CANLINK,SFGAO_CANRENAME,SFGAO_FOLDER,SFGAO_HASPROPSHEET,SFGAO_HASSUBFOLDER,SFGAO_STORAGEANCESTOR,
    [20:57:46] ProcessColumns pathidx=9
    [20:57:46] ub=21last=C:\Users\Public\ucShellBrowse41\Demo,cur=::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
    [20:57:46] MyComp::Get ShellView
    [20:57:46] MyComp::Get FolderView
    [20:57:46] Got colmgt,ct=4
    [20:57:46] NameLookup=System.ItemNameDisplay
    [20:57:46] NameLookup=System.ItemTypeText
    [20:57:46] NameLookup=System.Size
    [20:57:46] NameLookup=System.FreeSpace
    [20:57:46] SetColumns(9)=
    [20:57:46] SetColumns->Finished reconcile
    [20:57:46] ucShellBrowse.SetColumns->Error: Objektvariable oder With-Blockvariable nicht festgelegt, 0x5B
    DirChange ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
    [20:57:46] idxCB=9,lp=9
    [20:57:46] pvCreateDetailPaneBkg.pidlPar=122406272,pidlrel=121952800
    [20:57:46] pbh=56
    [20:57:46] btm=56,cx=58,icn=58,sys=32
    [20:57:46] Draw from JM
    [20:57:46] Loaded 0 files and 2 folders
    [20:57:46] MonitorPidl=139257568 ForPath=::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}
    
    Select subfolder of device:
    [20:55:37] Set IC flag = TRUE, item=0
    [20:55:37] LVSetSelection->Error: Objektvariable oder With-Blockvariable nicht festgelegt, 0x5B
    [20:55:37] pvCreateItemDetailPane()
    [20:55:37] LVItemClick 0
    [20:55:38] No IShellItem
    
    Dbl-click subfolder of device:
    [20:56:36] Got dblclk/ret
    [20:56:36] LVSetSelection->Error: Objektvariable oder With-Blockvariable nicht festgelegt, 0x5B
    [20:56:36] LVDoubleClick idx=0,lp=1,file=Interner gemeinsamer Speicher
    [20:56:36] LVDoubleClick->Failed to get IShellItem from parsing name
    [20:56:36] No IShellItem

  13. #93

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    1,940

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    I thought the issue was the device icon? Does the device icon show? It should, since that output looks like the device is present in the Computer folder and the dropdown. It looks like the problem is just with subfolders; do their icons show when you navigate to the device root?
    Wondering because if the root works ok, can we work around by using resolving with an IShellFolder always for the root and an relative pidl from there.
    If it's working in Win8.1, it definitely sounds like a bug in the APIs though. Just one other thought... what about passing the display names 'Internet...' instead of 'SID-...' after the root?

    I'll check it out myself in a bit, it's a cell phone or tablet right? Connected mine (also Android) as both file transfer and camera and could go as deep as I wanted without issue on Win7 too; I'll have to check on my roomies Win10 laptop later.

  14. #94
    Member
    Join Date
    Jan 2015
    Posts
    32

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Quote Originally Posted by fafalone View Post
    I thought the issue was the device icon? Does the device icon show? It should, since that output looks like the device is present in the Computer folder and the dropdown. It looks like the problem is just with subfolders; do their icons show when you navigate to the device root?
    Wondering because if the root works ok, can we work around by using resolving with an IShellFolder always for the root and an relative pidl from there.
    If it's working in Win8.1, it definitely sounds like a bug in the APIs though. Just one other thought... what about passing the display names 'Internet...' instead of 'SID-...' after the root?

    I'll check it out myself in a bit, it's a cell phone or tablet right? Connected mine (also Android) as both file transfer and camera and could go as deep as I wanted without issue on Win7 too; I'll have to check on my roomies Win10 laptop later.
    I need the pidl for the icon and also for other things, my post was indead misleading here, sorry.

    Yes, in your browser the device icon shows, and also the icons in the next sub level. But then it does not go down any deeper.

    > Just one other thought... what about passing the display names 'Internet...' instead of 'SID-...' after the root?
    I don't know what inspired you to this but it's exactly what I found out yesterday night by a mixture of internet and conincidence. It looks promising! I'll report back later...

    BTW, although I subscribed to the topic I never get email notifications from this forum. Is this normal?

  15. #95
    Member
    Join Date
    Jan 2015
    Posts
    32

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Problem solved!

    Display path:
    Code:
    Moto G (4)\SD-Karte von SanDisk\Test\IMG_0001.JPG
    This device path works in Win10 (but not in Win8.1):
    Code:
    ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SD-Karte von SanDisk\Test\IMG_0001.JPG
    This device path works in Win8.1 (but not in Win10):
    Code:
    ::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\\?\usb#vid_22b8&pid_2e82#zy223nmx76#{6ac27878-a6fa-4155-ba85-f98f491d4f33}\SID-{C8DB0001,,63831015424}\{00000CAE-0001-C8DB-0000-000000000000}\{00000CB1-0001-C8DB-0000-000000000000}
    So the workaround of this apparent Windows 10 bug is a simple string replacement.

    Thanks for your help and your invaluable typelib!

    Don

  16. #96

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    1,940

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Glad it worked out. I'll have to exceptions to handle this all over now too
    Had the idea because of a vaguely similar issue with recycle bin files a while back; can't recall the specifics.

    PS- For notifications, is the master option to receive e-mails enabled?

  17. #97
    Lively Member
    Join Date
    May 2016
    Location
    China
    Posts
    78

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Excuse me, why can't you reference it in VB.NET? Is it my way?
    QQ: 289778005

  18. #98
    Member
    Join Date
    Jan 2015
    Posts
    32

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    @fafalone:

    MSDN for IPortableDeviceManager::GetDevices says on pPnPDeviceIDs: "To learn the required size for this parameter, first call this method with this parameter set to NULL and pcPnPDeviceIDs set to zero".

    I think I have to pass 0& ByVal, right?
    Code:
    ret = MyPortableDeviceManager.GetDevices(ByVal 0&, cPnPDeviceIDs)
    Or should it be like this:
    Code:
    ret = MyPortableDeviceManager.GetDevices(0&, cPnPDeviceIDs)
    Thanks,
    Don

  19. #99

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    1,940

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    @voxy That parameter is ByVal so it wouldn't matter either way.

    Code:
    interface IPortableDeviceManager : stdole.IUnknown {
        long GetDevices(
                        [in] long pPnPDeviceIDs, 
                        [in] long *pcPnPDeviceIDs);
    @ChenLin, you can't reference the TLB in .NET? Is it this specific typelib or all the typelibs specifically designed for VB6? I don't have time to try running code right now but I did add the TLB as a reference without error in a VB.NET project in VS2015... I'll try to run some code with it tonight.

  20. #100
    Member
    Join Date
    Jan 2015
    Posts
    32

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Quote Originally Posted by fafalone View Post
    @voxy That parameter is ByVal so it wouldn't matter either way.
    It does not look ByVal in the definition (OLEEXP - olelib With Modern Interfaces by fafalone, v4.43):
    Code:
    Function GetDevices(pPnPDeviceIDs As Long, pcPnPDeviceIDs As Long) As Long

  21. #101
    Member
    Join Date
    Jan 2015
    Posts
    32

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    OK, just saw that apparently function parameters in typelibs never show "ByVal" even if they are ByVal. So one cannot know what they are, ByVal or ByRef, without looking into the source code of the typelib?

  22. #102
    Lively Member
    Join Date
    May 2016
    Location
    China
    Posts
    78

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    “The system can't find a specified reference“

    Can be added to a reference but not working properly.
    Both VB 2005 and 2017 show this error. Is it my WINDOWS system problem?
    QQ: 289778005

  23. #103

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    1,940

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    @voxy, that's unfortunately true. Sometimes there's clues in the naming conventions; and as a general rule, almost always the convention oleexp uses is to replace ByRef's for strings with ByVal and string pointers, for Unicode purposes, which is why the naming convention is broken here (it's byref in the original source as is the convention for vars prefixed with 'p').

    @ChenLin, so not when you add the TLB but when you try to run the code? Are you calling an interface not available on the current version of Windows?

  24. #104
    Lively Member
    Join Date
    May 2016
    Location
    China
    Posts
    78

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    @fafalone,Change the computer test to confirm that there is no problem, it is the computer windows system problem.
    QQ: 289778005

  25. #105
    Lively Member
    Join Date
    May 2016
    Location
    China
    Posts
    78

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    It's wrong. The 3.7 edition was just tested, and 4.443 is still not acceptable.
    QQ: 289778005

  26. #106

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    1,940

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Of the typelib?

    Can you be more specific about what exactly the error message is and when it appears?

    The only difference between 3.7 and 4.43 are added interfaces/types; there haven't been any changes to the TLB structure itself since long before that.

  27. #107
    Lively Member
    Join Date
    May 2016
    Location
    China
    Posts
    78

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    Name:  无标题.jpg
Views: 49
Size:  24.1 KB

    Please look at the picture。

    Debug error prompt:
    Severity Code Description Project File Line Suppression State
    Error Could not resolve COM reference "f9015e81-caac-45c0-94e8-42b7da5d7557" version 4.43. The type library importer encountered an error during type verification. Try importing without class members.
    Last edited by ChenLin; Jul 12th, 2018 at 09:39 PM.
    QQ: 289778005

  28. #108

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    1,940

    Re: [VB6] Modern Shell Interface Type Library - oleexp.tlb

    It looks like the file is in a different location than its registered to. Perhaps try unregistering then reregistering? This problem could arise if earlier 4.x versions in a different location were ever used.

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width