Home COM GDI+ WebBrowser Data Access

IItemNameLimits Interface

 

IID_IItemNameLimits

{1DF0D7F1-B267-4D28-8B10-12E23202A5C4}

 

 

The IItemNameLimits interface retrieves a list of valid and invalid characters or the maximum length of a name in the namespace. Use this interface for validation parsing and translation.

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IItemNameLimits Method

Description

GetValidCharacters

Loads a string that contains each of the characters that are valid or invalid in the namespace under which it is called.

GetMaxLength

Returns the maximum number of characters allowed for a particular name in the namespace under which it is called.

 

GetValidCharacters

 

FUNCTION Proto_IItemNameLimits_GetValidCharacters ( _
  BYVAL pthis AS DWORD PTR _
, BYREF ppwszValidChars AS DWORD _
, BYREF ppwszInvalidChars AS DWORD _
  ) AS LONG
 

FUNCTION IItemNameLimits_GetValidCharacters ( _
  BYVAL pthis AS DWORD PTR _
, BYREF strValidChars AS STRING _
, BYREF strInvalidChars AS STRING _
  ) AS LONG

  LOCAL HRESULT AS LONG

  LOCAL bstrlen AS LONG

  LOCAL ppwszValidChars AS DWORD

  LOCAL ppwszInvalidChars AS DWORD
  CALL DWORD @@pthis[3] USING Proto_IItemNameLimits_GetValidCharacters (pthis, ppwszValidChars, ppwszInvalidChars) TO HRESULT
  IF ISTRUE ppwszValidChars THEN
     bstrlen = lstrlenW(BYVAL ppwszValidChars)
     IF ISTRUE bstrlen THEN
        strValidChars = PEEK$(ppwszValidChars, bstrlen * 2)
        strValidChars = ACODE$(strValidChars)
     END IF
     CoTaskMemFree ppwszValidChars
  END IF
  IF ISTRUE ppwszInvalidChars THEN
     bstrlen = lstrlenW(BYVAL ppwszInvalidChars)
     IF ISTRUE bstrlen THEN
        strInvalidChars = PEEK$(ppwszInvalidChars, bstrlen * 2)
        strInvalidChars = ACODE$(strInvalidChars)
     END IF
     CoTaskMemFree ppwszInvalidChars
  END IF
  FUNCTION = HRESULT

END FUNCTION

 

 

GetMaxLength

 

FUNCTION IItemNameLimits_GetValidCharacters ( _
  BYVAL pthis AS DWORD PTR _
, BYVAL strName AS STRING _
, BYREF piMaxNameLen AS DWORD _
  ) AS LONG

  LOCAL HRESULT AS LONG

  strName = UCODE$(strName) & $NUL
  CALL DWORD @@pthis[4] USING IItemNameLimits_GetValidCharacters (pthis, strName, piMaxNameLen) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

Page last updated on Wednesday, 15 February 2006 22:54:46 +0100