Hello -
I am desperately trying to get the FindFirstUrlCacheEntry() function to
work under VB.NET. Unfortunately all I can find when I do a Google are
examples for older VB versions. The "As Any" does not work any more
and there are lots of other problems.
Could anybody tell me how to implement FindFirstUrlCacheEntry in
VB.NET?
Here is what I tried ...
Public Structure FILETIME
Dim dwLowDateTime As Long
Dim dwHighDateTime As Long
End Structure
Public Structure INTERNET_CACHE_ENTRY_INFO
Dim dwStructSize As Long
Dim lpszSourceUrlName As Long
Dim lpszLocalFileName As Long
Dim CacheEntryType As Long 'String
Dim dwUseCount As Long
Dim dwHitRate As Long
Dim dwSizeLow As Long
Dim dwSizeHigh As Long
Dim LastModifiedTime As FILETIME
Dim ExpireTIme As FILETIME
Dim LastAccessTime As FILETIME
Dim LastSyncTime As FILETIME
Dim lpHeaderInfo As Long
Dim dwHeaderInfoSize As Long
Dim lpszFileExtension As Long 'String
Dim dwReserved As Long
End Structure
Public Declare Function FindFirstUrlCacheEntry Lib "wininet" _
Alias "FindFirstUrlCacheEntryA" _
(ByVal lpszUrlSearchPattern As String, _
ByRef lpFirstCacheEntryInfo As INTERNET_CACHE_ENTRY_INFO, _
ByRef lpdwFirstCacheEntryInfoBufferSize As Long) As Long
....
Dim hFile As Long
Dim lData As INTERNET_CACHE_ENTRY_INFO
hFile = FindFirstUrlCacheEntry("http://msdn.microsoft.com/", lData ,
lBuffer)
This at least does not crash but I do not get any useful data out of
it. The problem must be that some of member variables (e.g.
lpszSourceUrlName) are actually pointers to strings.
How can I convert the Long to a String ... or rather how can I copy the
memory the Long points to into a String?
Thanks for any hints!
Joe