Help with FindFirstCacheEntry 
Author Message
 Help with FindFirstCacheEntry

Can someone tell me what I am doing wrong here.  It keeps bombing out on the
copymemory and my handle comes back with 0.
TIA.

Option Explicit
DefLng A-Z
Private Const ERROR_INSUFFICIENT_BUFFER = 122& '  dderror

Private Declare Function FindFirstUrlCacheEntry _
    Lib "wininet.dll" _
    Alias "FindFirstUrlCacheEntryA" _
    (lpszUrlSearchPattern As String, _
    lpFirstCacheEntryInfo As Any, _
    lpdwFirstCacheEntryInfoBufferSize As Long) As Long
Private Declare Function FindNextUrlCacheEntry _
    Lib "wininet.dll" _
    Alias "FindNextUrlCacheEntryA" _
    (hEnumHandle As Long, _
    lpNextCacheEntryInfo As Long, _
    lpdwNextCacheEntryInfoBufferSize As Long) As Boolean
Private Declare Function FindCloseUrlCache _
    Lib "wininet.dll" _
    (hEnumHandle As Long) As Boolean
Private Type FILETIME
    dwLowDateTime As Long
    dwHighDateTime As Long
End Type
Private Type INTERNET_CACHE_ENTRY_INFO
    dwStructSize As Long
    lpszSourceUrlName As Long
    lpszLocalFileName As Long
    CacheEntryType As Long
    dwUseCount As Long
    dwHitRate As Long
    dwSizeLow As Long
    dwSizeHigh As Long
    LastModifiedTime As FILETIME
    ExpireTime As FILETIME
    LastAccessTime As FILETIME
    LastSyncTime As FILETIME
    lpHeaderInfo As Long
    dwHeaderInfoSize As Long
    lpszFileExtension As Long
    dwReserved As Long
    dwExemptDelta As Long
End Type
Private Declare Sub CopyMemory Lib "kernel32" _
   Alias "RtlMoveMemory" _
  (pTo As Any, uFrom As Any, _
   ByVal lSize As Long)

Private Declare Function lstrlenW Lib "kernel32" _
  (ByVal lpString As Long) As Long

Private Sub Form_Load()
Dim buffer As Long
Dim HANDLE As Long
Dim Cache_Info As INTERNET_CACHE_ENTRY_INFO
Dim cachesize As Long
Dim bufsize As Long
Dim closehandle As Boolean
cachesize = LenB(Cache_Info)

HANDLE = FindFirstUrlCacheEntry("visited:", _
                                buffer, _
                                bufsize)

If HANDLE <> vbNull Then
    If HANDLE <> ERROR_INSUFFICIENT_BUFFER Then
        CopyMemory Cache_Info, buffer, bufsize
    End If
End If
closehandle = FindCloseUrlCache(HANDLE)
MsgBox "CloseHandle = " & Str(closehandle), vbOKOnly
End Sub

Private Sub Form_Resize()
    ListView1.Top = 100
    ListView1.Left = 100
    ListView1.Width = Me.Width - 325
    ListView1.Height = Me.Height - 800
End Sub



Mon, 23 Aug 2004 14:38:31 GMT  
 Help with FindFirstCacheEntry
I modified a lot to have codes work, the api declaration and the
INTERNET_CACHE_ENTRY_INFO structure, etc. The article below will help to
make the codes work.

HOWTO: Clear Cache When Your Application Hosts a WebBrowser Cont[ie_dev]
http://support.microsoft.com/support/kb/articles/q262/1/10.asp

Best Regards,

Alick Ye

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. Copy right, 2002 Microsoft Corporation.
All rights reserved.



Mon, 30 Aug 2004 16:47:39 GMT  
 Help with FindFirstCacheEntry
Thanks Alick.


Quote:
> I modified a lot to have codes work, the api declaration and the
> INTERNET_CACHE_ENTRY_INFO structure, etc. The article below will help to
> make the codes work.

> HOWTO: Clear Cache When Your Application Hosts a WebBrowser Cont[ie_dev]
> http://support.microsoft.com/support/kb/articles/q262/1/10.asp

> Best Regards,

> Alick Ye

> This posting is provided "AS IS" with no warranties, and confers no
rights.
> You assume all risk for your use. Copy right, 2002 Microsoft Corporation.
> All rights reserved.



Sun, 05 Sep 2004 13:12:34 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. help,help,help,help,help,help,help,help,help,help,help,help,help,

2. Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,Help,

3. Help, Help, Help, Help, Help, Help, Help, Help, Help, Help, Help, Help, Help, Help, Help, Help, Help,

4. HELP HELP HELP HELP HELP HELPHELP HELP HELPHELP HELP HELP

5. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

6. HELP HELP HELP HELP HELP HELP HELP HEL P HELP HE LP HELP HELP HEL P HELP HELP

7. Help Help Help Help Help Help !!!!!

8. HELP HELP HELP Set document name of print job from VB HELP HELP HELP

9. HELP HELP HELP Early Binding Excel 5.0 HELP HELP HELP

10. HELP HELP HELP HELP HELP

11. Help - Print - Help -Print - Help - Print - Help - Print - Help

12. help help help help help

 

 
Powered by phpBB® Forum Software