Solved

URLDownloadToCacheFile

Posted on 2004-03-21
6
892 Views
Last Modified: 2010-08-05
Hi,

When I use URLDownloadToCacheFile in my VB Code, I receive the following error:

DLL-Entry Point URLDownloadToCacheFile in URLMON.dll not found

My system is Windows 2000 Professional. urlmon.dll is very likely the most recent version, since it just got updated during a Windows Update (got the same error before the update).
Version Number: 6.0.2800.1400

To make things more confusing: URLDownloadToFile works without a problem, EVEN when I UNREGISTER c:\winnt\system32\urlmon.dll ! How is that possible?

Thanks for your help.
0
Comment
Question by:_Mark_
  • 3
  • 2
6 Comments
 
LVL 22

Expert Comment

by:cookre
Comment Utility
It works, and gives you that message?

Could you post the code...
0
 

Author Comment

by:_Mark_
Comment Utility
Well, URLDownloadToFile works, but URLDownloadToCacheFile doesn´t.

Code:

Private Declare Sub URLDownloadToCacheFile Lib "URLMON.dll" ( _
    ByVal lpunknown As Long, _
    ByVal lpcstr As String, _
    ByVal lptstr As String, _
    ByVal dword As Long, _
    ByVal dword As Long, _
    ByRef TLPBINDSTATUSCALLBACK As Long)
   
Private Sub Test()
   Dim url As String
   Dim localFileName As String
   
   On Error GoTo trackError
   
   url = "http://www.google.com/images/logo.gif"
     
   localFileName = Space(255)
   
   URLDownloadToCacheFile 0, url, localFileName, Len(localFileName), 0, 0
     
trackError:

Debug.Print Err.Description

End Sub
0
 

Author Comment

by:_Mark_
Comment Utility
Found the solution to my problem. Have to use an alias in the API declaration. This works:

Private Declare Function URLDownloadToCacheFile Lib "urlmon" Alias "URLDownloadToCacheFileA" ( _
   ByVal lpUnkcaller As Long, _
   ByVal szURL As String, _
   ByVal szFileName As String, _
   ByVal dwBufLength As Long, _
   ByVal dwReserved As Long, _
   ByVal IBindStatusCallback As Long) As Long
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 22

Expert Comment

by:cookre
Comment Utility
Yup, that's pretty common.

Go to Community Supprt, tell them you solved it yourself, and would they please delete the question and refund the points.

0
 

Author Comment

by:_Mark_
Comment Utility
Okay, thanks for your help though!
0
 

Accepted Solution

by:
amp072397 earned 0 total points
Comment Utility
Since the only other expert participating obviously agrees to PAQ:
PAQ, refund 250 points
amp, ee admin
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
This is an explanation of a simple data model to help parse a JSON feed
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now