How to adopt function DeleteUrlCacheEntry in HMG
That removes the file associated with the source name from the cache, if the file exists.
Syntax C++:
BOOLAPI DeleteUrlCacheEntry(
_In_ LPCTSTR lpszUrlName
);
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
How to adopt function DeleteUrlCacheEntry in HMG
Moderator: Rathinagiri
How to adopt function DeleteUrlCacheEntry in HMG
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
Re: How to adopt function DeleteUrlCacheEntry in HMG
For example, in this way:
Code: Select all
#include "hmg.ch"
MEMVAR _HMG_SYSDATA
FUNCTION Main()
LOCAL cURL := "http://myURL"
LOCAL nError
IF DeleteUrlCacheEntry(cURL, @nError)
MsgBox("Deleted!")
ELSE
//System Error Codes: https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381(v=vs.85).aspx
MsgBox("Error code: " + HB_NtoS(nError))
ENDIF
RETURN NIL
#pragma BEGINDUMP
#include <windows.h>
#include <Wininet.h>
#include "hbapi.h"
#include "SET_COMPILE_HMG_UNICODE.ch"
#include "HMG_UNICODE.h"
// DeleteUrlCacheEntry(cURL[, @nError])
HB_FUNC( DELETEURLCACHEENTRY )
{
BOOL bRetVal = DeleteUrlCacheEntry((LPCTSTR) HMG_parc(1));
DWORD nError = GetLastError();
if (HB_ISBYREF(2))
hb_stornl(nError, 2);
hb_retl(bRetVal);
}
#pragma ENDDUMP
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: How to adopt function DeleteUrlCacheEntry in HMG
A comment:
these header files should always go first
#include "SET_COMPILE_HMG_UNICODE.ch" #include "HMG_UNICODE.h"
because they activate / deactivate compilation in Unicode in the other header files
these header files should always go first
#include "SET_COMPILE_HMG_UNICODE.ch" #include "HMG_UNICODE.h"
because they activate / deactivate compilation in Unicode in the other header files
Re: How to adopt function DeleteUrlCacheEntry in HMG
Thank you Krzysztof
Thank you Dr. Claudio
Thank you Dr. Claudio
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG