Accessing IE cache (TIF) in windows service using WinInet APIs returns 12004

Answered Accessing IE cache (TIF) in windows service using WinInet APIs returns 12004

  • Thursday, August 02, 2012 12:59 PM
     
     

    Hello Experts,

    I am accessing IE cache (contents of Temporary Internet Files folder) from my application which runs as a windows service, using WinInet APIs. API used is "FindFirstUrlCacheEntry". My environment is:

    IE version: 9.0.811216421

    OS: Windows 7 Professional - Service Pack 1

    The access fails with error code 12004. The same code runs on another machine with exactly the same environment and the user having same previlidges. Kindly guide me as to how I can get rid of the error on the machine where my code is not working.

    Thanking everybody in advance

    Regards.

    P.S. I have studied the WinInet documentation in good detail. It says WinInet is not compatible with Windows services. It recommends using WinHTTP. I studied WinHTTP. It says that it will not cater to APIs for "url caching" and recommends using WinInet. Hence, I am using WinInet. I fail to understand the discrepancy in behavior in two identical environments.

All Replies

  • Friday, August 03, 2012 4:53 PM
     
     Answered

    Server applications that require HTTP client services should use WinHTTP instead of WinINet.

    Hard to tell what went wrong with the ERROR_INTERNET_INTERNAL_ERROR error code.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP

  • Saturday, August 04, 2012 5:34 AM
     
     

    Thank you for the reply Mr. Sheng Jiang.

    Could you tell me the API to access Temporary Internet Files using WinHTTP?

    Regards.

  • Saturday, August 04, 2012 2:04 PM
     
     Answered

    There is NO caching support from winhttp. You are responsible for writing the caching code and choose the cache directory. The directory structure of IE's cache directory is undocumented.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP