Note that there are some explanatory texts on larger screens.

plurals
  1. POHow To Get DeleteUrlCacheEntry() Error Codes? (Or additional information on why a particular deletion didn't work)?
    primarykey
    data
    text
    <p>Basically, when I call DeleteUrlCacheEntry (which is part of the Wininet.dll API) I either get returned the number 1 (which means, deletion successful) or the number 0 (which meant, deletion didn't work).</p> <p>My question is, how can I find out why a deletion did not work? (that is, when a 0 is returned). I heard there is a GetLastError() function in C++, however I am using VB6 and apparently the GetLastError equivalent in VB6 is the Err.LastDllError property.</p> <p>After a DeleteUrlCacheEntry attempted deletion fails (returns 0) I call/query the Err.LastDllError and it always returns 0 - no matter what. It returns 0 even if DeleteUrlCacheEntry returns 0 (deletion didn't work) and even when it returns 1 (deletion did work). I also make the call/query to Err.LastDllError as soon as possible (as in, right after the DeleteUrlCacheEntry call).</p> <p>I am really confused, because I don't even get a runtime error or any typical exception (or any exception for that matter). I do not have On Error Resume Next to ignore exception anywhere in my application, so every means of an error being reported to me is available but I cannot for the life of me figure out why a particular DeleteUrlCacheEntry() attempt will fail and return 0 (there doesn't seem to be a way for me to find out).</p> <p>So, my question is, how do I get extended error information from the DeleteUrlCacheEntry() function (residing in the wininet.dll API)?</p> <p>If you would like more information on the reason why I am looking for extended error information from the DeleteUrlCacheEntry() function, I have another question which details this (together with actual examples of cache items that work and don't work when a deletion is attempted): <a href="https://stackoverflow.com/questions/12096546/deleteurlcacheentry-function-of-wininet-api-not-deleting-some-internet-explo">https://stackoverflow.com/questions/12096546/deleteurlcacheentry-function-of-wininet-api-not-deleting-some-internet-explo</a></p> <p>Also, just to add, I am using VB6 - but principally it should be the same across most languages as it is an API call. Here is my declaration in VB6:</p> <blockquote> <p>Public Declare Function DeleteUrlCacheEntry Lib "WININET" Alias "DeleteUrlCacheEntryA" (ByVal lpszUrlName As String) As Long</p> </blockquote> <p>Also, I am calling it like this:</p> <blockquote> <p>Dim lReturnValue As Long</p> <p>Dim cacheFileString As String</p> <p>' GetStrFromPtrA turns Pointer (Long) to String. cacheFileString is the actual text/string of the lpszSourceUrlName turned from Pointer (Long) to String (human readable cache file name/string). Also, cacheFileString is retreived from FindFirst/NextEntry functions in a loop, so can't be incorrectly formatted or anything, as it also works when deleting most other items.</p> <p>cacheFileString = GetStrFromPtrA(icei.lpszSourceUrlName)</p> <p>lReturnValue = DeleteUrlCacheEntry(cacheFileString)</p> </blockquote> <p>The lReturnValue ends up being 0 if deletion didn't work, and 1 when deletion does work, and that is it. Also, <code>Err.LastDllError</code> always returns 0.</p> <p>Thank you for your anticipated assistance.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. CO@KenWhite The reason for the tags is because it applies to both C++ and Delphi as well (usage scenario is the same since it's a wininet.dll api call with error codes usually residing in a c++ .h file. So, it applies to people using these languages and those using these languages will also be able to make a contribution to this post.
      singulars
    2. CO@KenWhite it is not random, this is not a "code" issue just because some people wanted to see the code, it is an error codes issue, which applies to Delphi and C++ especially, notice i didn't include javascript, .NET or Java! Those would be random tags! API is universal across many languages which can hook into the Windows API, such as delphi and C++, which is why I seek the support of those people (getting extended error codes using API, not VB6-specific code). This is why people who are not closely involved in understanding the question should not edit tags or suggest close/delete etc.
      singulars
    3. COYou can call API functions from assembler, too; that doesn't make it an assembly question. And I'm quite familiar, thank you - I'm not exactly new here, if you view my profile and the tags for which I've answered questions. :-)
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload