[VB6] Modern Shell Interface Type Library - oleexp.tlb - Page 3-VBForums
Page 3 of 3 FirstFirst 123
Results 81 to 88 of 88

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

  1. #81

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

    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
    Lively Member
    Join Date
    Aug 2011
    Posts
    125

    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,776

    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,776

    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
    3

    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,776

    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

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

Survey posted by VBForums.