Posted on 2004-03-21
Last Modified: 2010-08-05

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.
Question by:_Mark_
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 22

Expert Comment

ID: 10643483
It works, and gives you that message?

Could you post the code...

Author Comment

ID: 10643523
Well, URLDownloadToFile works, but URLDownloadToCacheFile doesn´t.


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, _
Private Sub Test()
   Dim url As String
   Dim localFileName As String
   On Error GoTo trackError
   url = ""
   localFileName = Space(255)
   URLDownloadToCacheFile 0, url, localFileName, Len(localFileName), 0, 0

Debug.Print Err.Description

End Sub

Author Comment

ID: 10643599
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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

LVL 22

Expert Comment

ID: 10644244
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.


Author Comment

ID: 10644369
Okay, thanks for your help though!

Accepted Solution

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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
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…
Simple Linear Regression

636 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