Using Win32 functions in Visual FoxPro Image Gallery
URL Monikers
..msdn
CreateURLMonikerEx
FindMediaType
IsValidURL
ObtainUserAgentString
URLDownloadToCacheFile
URLDownloadToFile
UrlMkGetSessionOption
Code examples:
Validating URLs using moniker functions
Validating URLs using moniker functions

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
#DEFINE S_OK                   0
#DEFINE S_FALSE                1
#DEFINE E_INVALIDARG 0x80070057

DECLARE INTEGER IsValidURL IN urlmon;
    INTEGER pBC, STRING szURL, INTEGER dwReserved

= validateUrl ("http://www.news2news.com")
= validateUrl ("www.news2news.com")
= validateUrl ("http://if protocol prefix included it validates everything")

PROCEDURE  validateUrl (lcUrl)
    LOCAL lnResult
    lnResult = IsValidURL (0, a2w(lcUrl), 0)

    ? "Validating:", lcUrl, "-> "
    DO CASE
    CASE lnResult = S_OK
        ?? "URL is valid"
    CASE lnResult = S_FALSE
        ?? "URL is INvalid"
    CASE lnResult = E_INVALIDARG
        ?? "One of the parameters is invalid"
    OTHER
        ?? "Have no idea"
    ENDCASE

FUNCTION a2w (lcStr)
* converts source string to wide-chars
    LOCAL lcResult, ii
    lcResult = ""
    FOR ii=1 TO Len(lcStr)
        lcResult = lcResult + SUBSTR(lcStr, ii,1) + Chr(0)
    ENDFOR
RETURN lcResult+Chr(0)

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
904 bytes  
Created: 2001-11-14 19:22:01  
Modified: 2005-12-27 10:41:44  
Visits in 7 days: 56  
Listed functions:
IsValidURL
Printer friendly API declarations
My comment:
At least now this function does not look much useful to me.
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2018 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.39), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.226.33.117)
18 sec.Function: 'AVIStreamReadFormat'
Function group: 'Windows Multimedia'
36 sec.Function: 'DeleteEnhMetaFile'
Function group: 'Metafile'
55 sec.Function: 'SCardConnect'
Function group: 'Authentication'
1.25 min.Function: 'GetMenuItemInfo'
1.58 min.Function: 'SHBrowseForFolder'
Function group: 'Shell Functions'
1.9 min.Function: 'ShellAbout'
Function group: 'Shell Functions'
2.2 min.Function: 'FtpGetCurrentDirectory'
Function group: 'Internet Functions (WinInet)'
2.52 min.Function: 'CeGetSystemPowerStatusEx'
Function group: 'Remote Application Programming (RAPI)'
2.83 min.Function: 'CeDeleteRecord'
Function group: 'Remote Application Programming (RAPI)'
3.13 min.Function: 'OpenProcess'
Function group: 'Process and Thread'
Google
Advertise here!